Rename star/unstar actions to enable/disable/switch
Summary: Renamed actions "star" and "unstar" everywhere to "enable", "disable" and "switch". The logic behind original "star" action changed significantly, so this rename just makes everything much clearer. Please note that as a part of rename persisted state fields "userStarredPlugins" and "userStarredDevicePlugins" were renamed. I've added a "redux-persist" migration for seamless transition. Reviewed By: passy Differential Revision: D26606459 fbshipit-source-id: 83ad475f9b0231194701c40a2cdbda36f02c3d10
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e9bab76614
commit
fa3ff83595
@@ -15,6 +15,8 @@ import application, {
|
||||
import connections, {
|
||||
State as DevicesState,
|
||||
Action as DevicesAction,
|
||||
persistMigrations as devicesPersistMigrations,
|
||||
persistVersion as devicesPersistVersion,
|
||||
} from './connections';
|
||||
import pluginStates, {
|
||||
State as PluginStatesState,
|
||||
@@ -67,7 +69,7 @@ import {launcherConfigDir} from '../utils/launcher';
|
||||
import os from 'os';
|
||||
import {resolve} from 'path';
|
||||
import xdg from 'xdg-basedir';
|
||||
import {createTransform, persistReducer} from 'redux-persist';
|
||||
import {createMigrate, createTransform, persistReducer} from 'redux-persist';
|
||||
import {PersistPartial} from 'redux-persist/es/persistReducer';
|
||||
|
||||
import {Store as ReduxStore, MiddlewareAPI as ReduxMiddlewareAPI} from 'redux';
|
||||
@@ -140,10 +142,16 @@ export default combineReducers<State, Actions>({
|
||||
'userPreferredDevice',
|
||||
'userPreferredPlugin',
|
||||
'userPreferredApp',
|
||||
'userStarredPlugins',
|
||||
'userStarredDevicePlugins',
|
||||
'enabledPlugins',
|
||||
'enabledDevicePlugins',
|
||||
],
|
||||
transforms: [setTransformer({whitelist: ['userStarredDevicePlugins']})],
|
||||
transforms: [
|
||||
setTransformer({
|
||||
whitelist: ['enabledDevicePlugins', 'userStarredDevicePlugins'],
|
||||
}),
|
||||
],
|
||||
version: devicesPersistVersion,
|
||||
migrate: createMigrate(devicesPersistMigrations),
|
||||
},
|
||||
connections,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user