File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { createPinia } from 'pinia' ;
2
- import piniaPluginPersistence from 'pinia-plugin-persistedstate' ;
2
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' ;
3
3
4
4
const store = createPinia ( ) ;
5
- store . use ( piniaPluginPersistence ) ;
5
+ store . use ( piniaPluginPersistedstate ) ;
6
6
7
7
export default store ;
8
8
Original file line number Diff line number Diff line change @@ -15,17 +15,18 @@ export type Secret = {
15
15
password ?: string ;
16
16
} ;
17
17
export const useSecretStore = defineStore ( 'secretStore' , {
18
- state ( ) : {
18
+ state : ( ) : {
19
19
secrets : Secret [ ] ;
20
- } {
20
+ } => {
21
21
return {
22
22
secrets : [ ] ,
23
23
} ;
24
24
} ,
25
+ persist : true ,
25
26
getters : { } ,
26
27
actions : {
27
28
async loadSecrets ( ) {
28
- const secrets = ( await secretClient . getSecrets ( ) ) || [ ] ;
29
+ const secrets = ( await secretClient . getSecrets ( ) ) || this . secrets ;
29
30
this . secrets = secrets as Secret [ ] ;
30
31
} ,
31
32
async saveSecret ( secret : Secret ) {
You can’t perform that action at this time.
0 commit comments