Skip to content
Snippets Groups Projects

Resolve "allow to have plugins without panel"

Merged Piotr Gawron requested to merge 306-allow-to-have-plugins-without-panel into development
9 files
+ 26
11
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -3,7 +3,7 @@ import { useAppSelector } from '@/redux/hooks/useAppSelector';
import { isActiveLegendSelector } from '@/redux/legend/legend.selectors';
import { removePluginLegend, setDefaultLegendId } from '@/redux/legend/legend.slice';
import {
allActivePluginsSelector,
allActivePluginsWithPanelSelector,
isPluginActiveSelector,
isPluginLoadingSelector,
isPluginSelectedSelector,
@@ -42,12 +42,12 @@ export const useLoadPlugin = ({
const isPluginLoading = useAppSelector(state => isPluginLoadingSelector(state, hash));
const isPluginSelected = useAppSelector(state => isPluginSelectedSelector(state, hash));
const isActivePluginLegend = useAppSelector(state => isActiveLegendSelector(state, hash));
const allActivePlugins = useAppSelector(allActivePluginsSelector);
const allActivePluginsWithPanel = useAppSelector(allActivePluginsWithPanelSelector);
const dispatch = useAppDispatch();
const setLastPluginAsCurrentActivePlugin = (): void => {
const newAllActivePlugins = allActivePlugins.filter(p => p.hash !== hash);
const newAllActivePlugins = allActivePluginsWithPanel.filter(p => p.hash !== hash);
const lastActivePlugin = newAllActivePlugins.pop();
if (lastActivePlugin) {
dispatch(setCurrentDrawerPluginHash(lastActivePlugin.hash));
Loading