You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-03 23:50:33 +02:00
14 lines
573 B
TypeScript
14 lines
573 B
TypeScript
import { PluginStates } from '../../services/plugins/reducer';
|
|
import getActivePluginEditorViews from '../../services/plugins/utils/getActivePluginEditorViews';
|
|
import shim from '../../shim';
|
|
const { useMemo } = shim.react();
|
|
|
|
const useVisiblePluginEditorViewIds = (plugins: PluginStates, windowId: string) => {
|
|
return useMemo(() => {
|
|
const visibleViews = getActivePluginEditorViews(plugins, windowId, { mustBeVisible: true });
|
|
return visibleViews.flatMap(({ editorView }) => editorView.id);
|
|
}, [plugins, windowId]);
|
|
};
|
|
|
|
export default useVisiblePluginEditorViewIds;
|