File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const persistConfig = {
3232 key : 'root' ,
3333 storage : reduxStorage ,
3434 // increase version after store shape changes
35- version : 53 ,
35+ version : 54 ,
3636 stateReconciler : autoMergeLevel2 ,
3737 blacklist : [ 'receive' , 'ui' ] ,
3838 migrate : createMigrate ( migrations , { debug : __ENABLE_MIGRATION_DEBUG__ } ) ,
Original file line number Diff line number Diff line change @@ -153,6 +153,33 @@ const migrations = {
153153 } ,
154154 } ;
155155 } ,
156+ 54 : ( state ) : PersistedState => {
157+ // migrate widgets sort order
158+ const newSortOrder = state . widgets . sortOrder
159+ . map ( ( item ) => {
160+ // Handle slashfeed items
161+ if ( item . includes ( 'slashfeed:' ) ) {
162+ if ( item . includes ( 'Bitcoin Headlines' ) ) return 'news' ;
163+ if ( item . includes ( 'Bitcoin Price' ) ) return 'price' ;
164+ if ( item . includes ( 'Bitcoin Blocks' ) ) return 'blocks' ;
165+ if ( item . includes ( 'Bitcoin Facts' ) ) return 'facts' ;
166+ }
167+ // Non-slashfeed items pass through unchanged
168+ return item ;
169+ } )
170+ . filter ( ( item , index , arr ) => {
171+ // Remove duplicates
172+ return arr . indexOf ( item ) === index ;
173+ } ) ;
174+
175+ return {
176+ ...state ,
177+ widgets : {
178+ ...state . widgets ,
179+ sortOrder : newSortOrder ,
180+ } ,
181+ } ;
182+ } ,
156183} ;
157184
158185export default migrations ;
You can’t perform that action at this time.
0 commit comments