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
@@ -222,7 +222,7 @@ export default class Client extends EventEmitter {
|
||||
isEnabledPlugin(pluginId: string) {
|
||||
return this.store
|
||||
.getState()
|
||||
.connections.userStarredPlugins[this.query.app]?.includes(pluginId);
|
||||
.connections.enabledPlugins[this.query.app]?.includes(pluginId);
|
||||
}
|
||||
|
||||
shouldConnectAsBackgroundPlugin(pluginId: string) {
|
||||
@@ -294,7 +294,7 @@ export default class Client extends EventEmitter {
|
||||
plugin: PluginDefinition | undefined,
|
||||
isEnabled = plugin ? this.isEnabledPlugin(plugin.id) : false,
|
||||
) {
|
||||
// start a plugin on start if it is a SandyPlugin, which is starred, and doesn't have persisted state yet
|
||||
// start a plugin on start if it is a SandyPlugin, which is enabled, and doesn't have persisted state yet
|
||||
if (
|
||||
isSandyPlugin(plugin) &&
|
||||
(isEnabled || defaultEnabledBackgroundPlugins.includes(plugin.id)) &&
|
||||
@@ -375,7 +375,7 @@ export default class Client extends EventEmitter {
|
||||
!newBackgroundPlugins.includes(plugin) &&
|
||||
this.store
|
||||
.getState()
|
||||
.connections.userStarredPlugins[this.query.app]?.includes(plugin)
|
||||
.connections.enabledPlugins[this.query.app]?.includes(plugin)
|
||||
) {
|
||||
this.deinitPlugin(plugin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user