|
Lines 5-11
export const useMainStore = defineStore("main", {
Link Here
|
| 5 |
_message: null, |
5 |
_message: null, |
| 6 |
_error: null, |
6 |
_error: null, |
| 7 |
_warning: null, |
7 |
_warning: null, |
| 8 |
_confirmation: null, |
8 |
_confirmation_title: null, |
|
|
9 |
_confirmation_message: null, |
| 9 |
_accept_callback: null, |
10 |
_accept_callback: null, |
| 10 |
previousMessage: null, |
11 |
previousMessage: null, |
| 11 |
previousError: null, |
12 |
previousError: null, |
|
Lines 18-41
export const useMainStore = defineStore("main", {
Link Here
|
| 18 |
this._error = null; |
19 |
this._error = null; |
| 19 |
this._warning = null; |
20 |
this._warning = null; |
| 20 |
this._message = message; |
21 |
this._message = message; |
| 21 |
this._confirmation = null; |
22 |
this._confirmation_title = null; |
|
|
23 |
this._confirmation_message = null; |
| 22 |
this.displayed_already = displayed; /* Will be displayed on the next view */ |
24 |
this.displayed_already = displayed; /* Will be displayed on the next view */ |
| 23 |
}, |
25 |
}, |
| 24 |
setError(error, displayed = true) { |
26 |
setError(error, displayed = true) { |
| 25 |
this._error = error; |
27 |
this._error = error; |
| 26 |
this._warning = null; |
28 |
this._warning = null; |
| 27 |
this._message = null; |
29 |
this._message = null; |
| 28 |
this._confirmation = null; |
30 |
this._confirmation_title = null; |
|
|
31 |
this._confirmation_message = null; |
| 29 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
32 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
| 30 |
}, |
33 |
}, |
| 31 |
setWarning(warning, displayed = true) { |
34 |
setWarning(warning, displayed = true) { |
| 32 |
this._error = null; |
35 |
this._error = null; |
| 33 |
this._warning = warning; |
36 |
this._warning = warning; |
| 34 |
this._message = null; |
37 |
this._message = null; |
| 35 |
this._confirmation = null; |
38 |
this._confirmation_title = null; |
|
|
39 |
this._confirmation_message = null; |
| 36 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
40 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
| 37 |
}, |
41 |
}, |
| 38 |
setConfirmation(confirmation, accept_callback, displayed = true){ |
42 |
setConfirmationDialog(confirmation_title, confirmation_message, accept_callback, displayed = true){ |
| 39 |
if(accept_callback) { |
43 |
if(accept_callback) { |
| 40 |
this._accept_callback = async () => { |
44 |
this._accept_callback = async () => { |
| 41 |
await accept_callback() |
45 |
await accept_callback() |
|
Lines 45-51
export const useMainStore = defineStore("main", {
Link Here
|
| 45 |
this._error = null; |
49 |
this._error = null; |
| 46 |
this._warning = null; |
50 |
this._warning = null; |
| 47 |
this._message = null; |
51 |
this._message = null; |
| 48 |
this._confirmation = confirmation; |
52 |
this._confirmation_title = confirmation_title; |
|
|
53 |
this._confirmation_message = confirmation_message; |
| 49 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
54 |
this.displayed_already = displayed; /* Is displayed on the current view */ |
| 50 |
}, |
55 |
}, |
| 51 |
removeMessages() { |
56 |
removeMessages() { |
|
Lines 53-59
export const useMainStore = defineStore("main", {
Link Here
|
| 53 |
this._error = null; |
58 |
this._error = null; |
| 54 |
this._warning = null; |
59 |
this._warning = null; |
| 55 |
this._message = null; |
60 |
this._message = null; |
| 56 |
this._confirmation = null; |
61 |
this._confirmation_title = null; |
|
|
62 |
this._confirmation_message = null; |
| 57 |
this._accept_callback = null; |
63 |
this._accept_callback = null; |
| 58 |
} |
64 |
} |
| 59 |
this.displayed_already = true; |
65 |
this.displayed_already = true; |
|
Lines 81-88
export const useMainStore = defineStore("main", {
Link Here
|
| 81 |
message() { |
87 |
message() { |
| 82 |
return this._message |
88 |
return this._message |
| 83 |
}, |
89 |
}, |
| 84 |
confirmation() { |
90 |
confirmation_title() { |
| 85 |
return this._confirmation |
91 |
return this._confirmation_title |
|
|
92 |
}, |
| 93 |
confirmation_message() { |
| 94 |
return this._confirmation_message |
| 86 |
}, |
95 |
}, |
| 87 |
accept_callback() { |
96 |
accept_callback() { |
| 88 |
return this._accept_callback |
97 |
return this._accept_callback |
| 89 |
- |
|
|