mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
show use_alt_np as disabled if dependent setting is disabled
+ add getters to settings store + add use sidebar setting
This commit is contained in:
@@ -1,16 +1,29 @@
|
||||
import { defineStore } from "pinia";
|
||||
import useQueueStore from "../queue";
|
||||
|
||||
export default defineStore("settings", {
|
||||
state: () => ({
|
||||
use_alt_np: false,
|
||||
use_sidebar: true,
|
||||
}),
|
||||
actions: {
|
||||
toggleUseRightNP() {
|
||||
if (!this.use_sidebar) return;
|
||||
this.use_alt_np = !this.use_alt_np;
|
||||
useQueueStore();
|
||||
},
|
||||
toggleDisableSidebar() {
|
||||
this.use_sidebar = !this.use_sidebar;
|
||||
},
|
||||
},
|
||||
getters: {
|
||||
show_alt_np(): boolean {
|
||||
return this.use_sidebar && this.use_alt_np;
|
||||
},
|
||||
show_default_np(): boolean {
|
||||
return !this.show_alt_np;
|
||||
},
|
||||
disable_show_alt_np(): boolean {
|
||||
return !this.use_sidebar;
|
||||
},
|
||||
},
|
||||
getters: {},
|
||||
persist: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user