We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c3f5a5 commit 222eccaCopy full SHA for 222ecca
electron/renderer/hooks/layouts.tsx
@@ -4,6 +4,17 @@ import type { Maybe } from '../../common/types.js';
4
import { runInBackground } from '../lib/async/run-in-background.js';
5
import { usePubSub, useSubscribe } from './pubsub.jsx';
6
7
+export const useLoadedLayout = (): Maybe<Layout> => {
8
+ const [layoutName, setLayoutName] = useState<string>('default');
9
+ const layout = useGetLayout(layoutName);
10
+
11
+ useSubscribe(['layout:load'], (layoutName: string) => {
12
+ setLayoutName(layoutName);
13
+ });
14
15
+ return layout;
16
+};
17
18
/**
19
* Gets the layout configuration for a given layout name.
20
* Automatically refreshes the layout when it is saved or deleted.
0 commit comments