From 8d889762872501eebd5edb5d7cacddfd4cd55ad4 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 28 Feb 2020 04:09:40 +0100 Subject: viewer: more minor architectural improvement --- viewer/src/store/galleryStore.ts | 2 +- viewer/src/store/uiStore.ts | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'viewer/src/store') diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index 9950f5b..bc43ed2 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts @@ -36,7 +36,7 @@ export default class GalleryStore extends VuexModule { // --- - @mutation setConfig(config: Gallery.Config) { + @mutation private setConfig(config: Gallery.Config) { this.config = config; } diff --git a/viewer/src/store/uiStore.ts b/viewer/src/store/uiStore.ts index 1e63b3e..21f9ce9 100644 --- a/viewer/src/store/uiStore.ts +++ b/viewer/src/store/uiStore.ts @@ -21,7 +21,7 @@ import { createModule, mutation, action } from "vuex-class-component"; const VuexModule = createModule({ namespaced: "uiStore", - strict: false + strict: true }) export default class UIStore extends VuexModule { @@ -32,11 +32,15 @@ export default class UIStore extends VuexModule { // --- - @mutation toggleFullscreen() { - this.fullscreen = !this.fullscreen; + @mutation toggleFullscreen(value?: boolean) { + this.fullscreen = value ?? !this.fullscreen; } - @mutation toggleFullWidth() { - this.fullWidth = !this.fullWidth; + @mutation toggleFullWidth(value?: boolean) { + this.fullWidth = value ?? !this.fullWidth; + } + + @mutation toggleSearchMode(value?: boolean) { + this.searchMode = value ?? !this.searchMode; } } -- cgit v1.2.3