1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-15 02:56:18 +02:00

import style.css n fix settings not updating correctly

This commit is contained in:
Kushagra Gour
2021-03-31 03:22:04 +05:30
parent f540ffb936
commit 4da8415636

View File

@ -66,6 +66,7 @@ import {
SHOW_KEYBOARD_SHORTCUTS_EVENT SHOW_KEYBOARD_SHORTCUTS_EVENT
} from '../commands'; } from '../commands';
import { commandPaletteService } from '../commandPaletteService'; import { commandPaletteService } from '../commandPaletteService';
import './../style.css';
import { I18nProvider } from '@lingui/react'; import { I18nProvider } from '@lingui/react';
@ -951,12 +952,14 @@ export default class App extends Component {
* Handles all user triggered preference changes in the UI. * Handles all user triggered preference changes in the UI.
*/ */
updateSetting(settingName, value) { updateSetting(settingName, value) {
const prefs = { ...this.state.prefs };
// If this was triggered from user interaction, save the setting // If this was triggered from user interaction, save the setting
if (settingName) { if (settingName) {
// var settingName = e.target.dataset.setting; // var settingName = e.target.dataset.setting;
var obj = {}; var obj = {};
log(settingName, value); log(settingName, value);
const prefs = { ...this.state.prefs }; // const prefs = { ...this.state.prefs };
prefs[settingName] = value; prefs[settingName] = value;
obj[settingName] = prefs[settingName]; obj[settingName] = prefs[settingName];
this.setState({ prefs }); this.setState({ prefs });
@ -983,9 +986,7 @@ export default class App extends Component {
trackEvent('ui', 'updatePref-' + settingName, prefs[settingName]); trackEvent('ui', 'updatePref-' + settingName, prefs[settingName]);
} }
const prefs = this.state.prefs; this.contentWrap.applyCodemirrorSettings(prefs);
this.contentWrap.applyCodemirrorSettings(this.state.prefs);
if (prefs.autoSave) { if (prefs.autoSave) {
if (!this.autoSaveInterval) { if (!this.autoSaveInterval) {