Lines 6-12
export const useMainStore = defineStore("main", {
Link Here
|
6 |
_error: null, |
6 |
_error: null, |
7 |
_warning: null, |
7 |
_warning: null, |
8 |
_confirmation: null, |
8 |
_confirmation: null, |
9 |
_accept: null, |
9 |
_accept_callback: null, |
10 |
previousMessage: null, |
10 |
previousMessage: null, |
11 |
previousError: null, |
11 |
previousError: null, |
12 |
displayed_already: false, |
12 |
displayed_already: false, |
Lines 28-44
export const useMainStore = defineStore("main", {
Link Here
|
28 |
this._confirmation = null; |
28 |
this._confirmation = null; |
29 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
29 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
30 |
}, |
30 |
}, |
31 |
setWarning(warning, accept, displayed = true) { |
31 |
setWarning(warning, displayed = true) { |
32 |
this._error = null; |
32 |
this._error = null; |
33 |
this._warning = warning; |
33 |
this._warning = warning; |
34 |
this._message = null; |
34 |
this._message = null; |
35 |
this._confirmation = null; |
35 |
this._confirmation = null; |
36 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
36 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
37 |
}, |
37 |
}, |
38 |
setConfirmation(confirmation, accept, displayed = true){ |
38 |
setConfirmation(confirmation, accept_callback, displayed = true){ |
39 |
if(accept) { |
39 |
if(accept_callback) { |
40 |
this._accept = async () => { |
40 |
this._accept_callback = async () => { |
41 |
await accept() |
41 |
await accept_callback() |
42 |
this.removeMessages() |
42 |
this.removeMessages() |
43 |
} |
43 |
} |
44 |
} |
44 |
} |
Lines 54-60
export const useMainStore = defineStore("main", {
Link Here
|
54 |
this._warning = null; |
54 |
this._warning = null; |
55 |
this._message = null; |
55 |
this._message = null; |
56 |
this._confirmation = null; |
56 |
this._confirmation = null; |
57 |
this._accept = null; |
57 |
this._accept_callback = null; |
58 |
} |
58 |
} |
59 |
this.displayed_already = true; |
59 |
this.displayed_already = true; |
60 |
}, |
60 |
}, |
Lines 84-91
export const useMainStore = defineStore("main", {
Link Here
|
84 |
confirmation() { |
84 |
confirmation() { |
85 |
return this._confirmation |
85 |
return this._confirmation |
86 |
}, |
86 |
}, |
87 |
accept() { |
87 |
accept_callback() { |
88 |
return this._accept |
88 |
return this._accept_callback |
89 |
}, |
89 |
}, |
90 |
is_submitting(){ |
90 |
is_submitting(){ |
91 |
return this._is_submitting |
91 |
return this._is_submitting |
92 |
- |
|
|