Skip to content

Commit

Permalink
Fix check active plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ziulev committed Dec 6, 2021
1 parent b80ed33 commit 9c7448d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/plugins.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,17 @@ export const PluginsProvider: FC<{}> = (props) => {
const connectPluginCommand = async (
command: (PluginCommand & {type: CommandType.connectPlugin})
) => {
// TODO: check uniq plugin name
// TODO: check if plugin doesn't have a uniq name
// Otherwise there will be a conflict when setting data to storage
const activePlugin = activePlugins$.value.find(p =>
p.path === command.value.path,
p.name === command.value.name,
);

if (activePlugin) {
stopPluginScript(activePlugin.pid);
removePluginRegistries(activePlugin.path);
activePlugins$.next(
activePlugins$.value.filter(p => p.path !== activePlugin.path),
activePlugins$.value.filter(p => p.name !== activePlugin.name),
);
};

Expand Down

0 comments on commit 9c7448d

Please sign in to comment.