Load areas into store (#913)
This commit is contained in:
parent
aa686702e9
commit
3a1b4ca1b4
1 changed files with 9 additions and 0 deletions
|
|
@ -164,6 +164,15 @@ const Layout: React.FC<LayoutProps> = ({
|
|||
loadProjects();
|
||||
}, [projects.length, isProjectsLoading, setProjects]);
|
||||
|
||||
useEffect(() => {
|
||||
// Load areas into global store if not already loaded
|
||||
const { hasLoaded, isLoading, loadAreas } =
|
||||
useStore.getState().areasStore;
|
||||
if (!hasLoaded && !isLoading) {
|
||||
loadAreas();
|
||||
}
|
||||
}, []);
|
||||
|
||||
const openNoteModal = (note: Note | null = null) => {
|
||||
setSelectedNote(note);
|
||||
setIsNoteModalOpen(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue