Stop counting disabled and gatekeeped plugins as loaded
Summary: Without this change gatekeeped and disabled plugins are also counted as loaded, which results in plugin duplication in the UI Reviewed By: lblasa Differential Revision: D39695335 fbshipit-source-id: 759e2e0eaead1bee0f7d61e4ba3d1b8e4b6c0976
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fd811db12b
commit
31fb3dd5be
@@ -299,7 +299,18 @@ function updateClientPlugin(
|
|||||||
clientsWithEnabledPlugin.forEach((client) => {
|
clientsWithEnabledPlugin.forEach((client) => {
|
||||||
startPlugin(client, plugin, true);
|
startPlugin(client, plugin, true);
|
||||||
});
|
});
|
||||||
store.dispatch(pluginLoaded(plugin));
|
if (
|
||||||
|
!store
|
||||||
|
.getState()
|
||||||
|
.plugins.disabledPlugins.find(
|
||||||
|
(disabledPlugin) => disabledPlugin.id === plugin.id,
|
||||||
|
) &&
|
||||||
|
!store
|
||||||
|
.getState()
|
||||||
|
.plugins.gatekeepedPlugins.find((gkPlugin) => gkPlugin.id === plugin.id)
|
||||||
|
) {
|
||||||
|
store.dispatch(pluginLoaded(plugin));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDevicePlugin(
|
function updateDevicePlugin(
|
||||||
@@ -317,10 +328,21 @@ function updateDevicePlugin(
|
|||||||
devicesWithEnabledPlugin.forEach((d) => {
|
devicesWithEnabledPlugin.forEach((d) => {
|
||||||
d.unloadDevicePlugin(plugin.id);
|
d.unloadDevicePlugin(plugin.id);
|
||||||
});
|
});
|
||||||
store.dispatch(pluginLoaded(plugin));
|
|
||||||
devicesWithEnabledPlugin.forEach((d) => {
|
devicesWithEnabledPlugin.forEach((d) => {
|
||||||
d.loadDevicePlugin(plugin);
|
d.loadDevicePlugin(plugin);
|
||||||
});
|
});
|
||||||
|
if (
|
||||||
|
!store
|
||||||
|
.getState()
|
||||||
|
.plugins.disabledPlugins.find(
|
||||||
|
(disabledPlugin) => disabledPlugin.id === plugin.id,
|
||||||
|
) &&
|
||||||
|
!store
|
||||||
|
.getState()
|
||||||
|
.plugins.gatekeepedPlugins.find((gkPlugin) => gkPlugin.id === plugin.id)
|
||||||
|
) {
|
||||||
|
store.dispatch(pluginLoaded(plugin));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPlugin(
|
function startPlugin(
|
||||||
|
|||||||
Reference in New Issue
Block a user