diff --git a/src/App.tsx b/src/App.tsx index 54a729d..853a6d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,8 @@ -import { Component, Vue } from 'vue-property-decorator' +import { Component, Vue, Watch } from 'vue-property-decorator' import Mousetrap from 'mousetrap' import { AppModule } from '@/store/app' import { PageModule } from './store/page' -import { focusInputPassword } from './utils/helper' +import { Debounce, focusInputPassword } from './utils/helper' import { hotkeys } from '@/utils/hotkeys' @Component @@ -11,6 +11,17 @@ export default class MainApp extends Vue { return AppModule.bodyClass } + get getMainSettings() { + return AppModule.getMainSettings + } + + @Debounce(100) + @Watch('getMainSettings', { deep: true }) + handleSettingsThemes() { + console.log('Update Settings') + AppModule.syncSettingsWithCache() + } + created() { AppModule.setUpSettings() this.initKeybinds() diff --git a/src/components/app/AppButton.tsx b/src/components/app/AppButton.tsx index fb16725..4d415d5 100644 --- a/src/components/app/AppButton.tsx +++ b/src/components/app/AppButton.tsx @@ -2,8 +2,6 @@ import { Component, Prop, Vue } from 'vue-property-decorator' import AppIcon from '@/components/app/AppIcon.vue' import { Route } from 'vue-router' import { CreateElement, VNode, VNodeData } from 'vue' -import { RenderContext } from 'vue/types/umd' -import { spawn } from 'child_process' const prefix = 'app-button' @@ -52,9 +50,7 @@ export default class AppButton extends Vue implements AppButtonPropsInterface { classes[`${prefix}--${property}`] = !!this[property] }) - return { - ...classes - } + return classes } get isLink() { diff --git a/src/components/app/AppCheckbox.tsx b/src/components/app/AppCheckbox.tsx index e2700d7..dfe0404 100644 --- a/src/components/app/AppCheckbox.tsx +++ b/src/components/app/AppCheckbox.tsx @@ -5,13 +5,20 @@ import AppIcon from '@/components/app/AppIcon.vue' components: { AppIcon } }) export default class AppCheckbox extends Vue { - @Prop({ type: Boolean, default: false }) value!: boolean + @Prop({ default: false }) value!: boolean @Prop({ default: '' }) label!: string get isActive() { return this.value } + get classes() { + return { + checkbox: true, + 'checkbox--active': this.value + } + } + get idCheckbox() { return `input-${(this as any)._uid}` } @@ -21,7 +28,7 @@ export default class AppCheckbox extends Vue { } render() { - return