File tree 1 file changed +19
-17
lines changed
1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -3,24 +3,26 @@ const Store = require("electron-store");
3
3
4
4
const defaults = require ( "./defaults" ) ;
5
5
6
+ const migrations = {
7
+ ">=1.7.0" : ( store ) => {
8
+ const enabledPlugins = store . get ( "plugins" ) ;
9
+ if ( ! Array . isArray ( enabledPlugins ) ) {
10
+ console . warn ( "Plugins are not in array format, cannot migrate" ) ;
11
+ return ;
12
+ }
13
+
14
+ const plugins = { } ;
15
+ enabledPlugins . forEach ( ( enabledPlugin ) => {
16
+ plugins [ enabledPlugin ] = {
17
+ enabled : true ,
18
+ } ;
19
+ } ) ;
20
+ store . set ( "plugins" , plugins ) ;
21
+ } ,
22
+ } ;
23
+
6
24
module . exports = new Store ( {
7
25
defaults,
8
26
clearInvalidConfig : false ,
9
- migrations : {
10
- ">=1.7.0" : ( store ) => {
11
- const enabledPlugins = store . get ( "plugins" ) ;
12
- if ( ! Array . isArray ( enabledPlugins ) ) {
13
- console . warn ( "Plugins are not in array format, cannot migrate" ) ;
14
- return ;
15
- }
16
-
17
- const plugins = { } ;
18
- enabledPlugins . forEach ( ( enabledPlugin ) => {
19
- plugins [ enabledPlugin ] = {
20
- enabled : true ,
21
- } ;
22
- } ) ;
23
- store . set ( "plugins" , plugins ) ;
24
- } ,
25
- } ,
27
+ migrations,
26
28
} ) ;
You can’t perform that action at this time.
0 commit comments