settings modal minimization API
This commit is contained in:
parent
f65f595f75
commit
e30ff80995
5 changed files with 39 additions and 17 deletions
|
|
@ -133,6 +133,23 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
}
|
||||
}
|
||||
},
|
||||
setSettingsModalState(newState) {
|
||||
const oldState = this.settingsModalState
|
||||
const legal = (() => {
|
||||
switch (oldState) {
|
||||
case 'minimized':
|
||||
return true
|
||||
case 'visible':
|
||||
return true
|
||||
case 'hidden':
|
||||
return newState === 'visible'
|
||||
}
|
||||
})()
|
||||
|
||||
if (legal) {
|
||||
this.settingsModalState = newState
|
||||
}
|
||||
},
|
||||
togglePeekSettingsModal() {
|
||||
switch (this.settingsModalState) {
|
||||
case 'minimized':
|
||||
|
|
@ -141,8 +158,10 @@ export const useInterfaceStore = defineStore('interface', {
|
|||
case 'visible':
|
||||
this.settingsModalState = 'minimized'
|
||||
return
|
||||
case 'hidden':
|
||||
return
|
||||
default:
|
||||
throw new Error('Illegal minimization state of settings modal')
|
||||
throw new Error(`Illegal minimization state of settings modal: ${this.settingsModalState}`)
|
||||
}
|
||||
},
|
||||
clearSettingsModalTargetTab() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue