fix temporary changes not working
This commit is contained in:
parent
76c1ab13ec
commit
4b51432ff1
3 changed files with 14 additions and 3 deletions
0
changelog.d/temp-changes.skip
Normal file
0
changelog.d/temp-changes.skip
Normal file
|
|
@ -109,15 +109,15 @@ const config = {
|
||||||
|
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
dispatch('setOption', { name, value })
|
dispatch('setOption', { name, value })
|
||||||
commit('clearTemporaryChanges')
|
useInterfaceStore().clearTemporaryChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
const revert = () => {
|
const revert = () => {
|
||||||
commit('setOptionTemporarily', { name, value: oldValue })
|
commit('setOptionTemporarily', { name, value: oldValue })
|
||||||
commit('clearTemporaryChanges')
|
useInterfaceStore().clearTemporaryChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
commit('setTemporaryChanges', {
|
useInterfaceStore().setTemporaryChanges({
|
||||||
timeoutId: setTimeout(revert, 10000),
|
timeoutId: setTimeout(revert, 10000),
|
||||||
confirm,
|
confirm,
|
||||||
revert
|
revert
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,17 @@ export const useInterfaceStore = defineStore('interface', {
|
||||||
lastTimeline: null
|
lastTimeline: null
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
|
setTemporaryChanges ({ timeoutId, confirm, revert }) {
|
||||||
|
this.temporaryChangesTimeoutId = timeoutId
|
||||||
|
this.temporaryChangesConfirm = confirm
|
||||||
|
this.temporaryChangesRevert = revert
|
||||||
|
},
|
||||||
|
clearTemporaryChanges () {
|
||||||
|
clearTimeout(this.temporaryChangesTimeoutId)
|
||||||
|
this.temporaryChangesTimeoutId = null
|
||||||
|
this.temporaryChangesConfirm = () => {}
|
||||||
|
this.temporaryChangesRevert = () => {}
|
||||||
|
},
|
||||||
setPageTitle (option = '') {
|
setPageTitle (option = '') {
|
||||||
try {
|
try {
|
||||||
document.title = `${option} ${window.vuex.state.instance.name}`
|
document.title = `${option} ${window.vuex.state.instance.name}`
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue