fix: prompts disappearing on copy / move / upload (#3537)
--------- Co-authored-by: Ryan Miller <ryan.miller@infinitetactics.com> Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
@@ -29,6 +29,12 @@ export const useLayoutStore = defineStore("layout", {
|
||||
toggleShell() {
|
||||
this.showShell = !this.showShell;
|
||||
},
|
||||
setCloseOnPrompt(closeFunction: () => Promise<string>, onPrompt: string) {
|
||||
const prompt = this.prompts.find((prompt) => prompt.prompt === onPrompt);
|
||||
if (prompt) {
|
||||
prompt.close = closeFunction;
|
||||
}
|
||||
},
|
||||
showHover(value: PopupProps | string) {
|
||||
if (typeof value !== "object") {
|
||||
this.prompts.push({
|
||||
@@ -36,6 +42,7 @@ export const useLayoutStore = defineStore("layout", {
|
||||
confirm: null,
|
||||
action: undefined,
|
||||
props: null,
|
||||
close: null,
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -45,6 +52,7 @@ export const useLayoutStore = defineStore("layout", {
|
||||
confirm: value?.confirm,
|
||||
action: value?.action,
|
||||
props: value?.props,
|
||||
close: value?.close,
|
||||
});
|
||||
},
|
||||
showError() {
|
||||
@@ -53,6 +61,7 @@ export const useLayoutStore = defineStore("layout", {
|
||||
confirm: null,
|
||||
action: undefined,
|
||||
props: null,
|
||||
close: null,
|
||||
});
|
||||
},
|
||||
showSuccess() {
|
||||
@@ -61,10 +70,11 @@ export const useLayoutStore = defineStore("layout", {
|
||||
confirm: null,
|
||||
action: undefined,
|
||||
props: null,
|
||||
close: null,
|
||||
});
|
||||
},
|
||||
closeHovers() {
|
||||
this.prompts.pop();
|
||||
this.prompts.shift()?.close?.();
|
||||
},
|
||||
// easily reset state using `$reset`
|
||||
clearLayout() {
|
||||
|
||||
Reference in New Issue
Block a user