Skip to content

Commit

Permalink
Updated context provider to store projects locally
Browse files Browse the repository at this point in the history
Signed-off-by: Luke McFarlane <luke.mcfarlane@rocketlab.com.au>
  • Loading branch information
luke-mcfarlane-rocketlab committed Dec 11, 2024
1 parent e54149d commit 4b77e26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/context/projects-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
activateProjectDB,
getProjectsDB,
setSyncProjectDB,
updateProjectsDB,
} from '../dbs/projects-db';
import {activate_project} from '../sync/process-initialization';
import {ProjectExtended} from '../types/project';
Expand Down Expand Up @@ -70,7 +71,10 @@ export function ProjectsProvider({children}: {children: ReactNode}) {
});
}

setProjects([...newProjectsMap.values()]);
const newProjects = [...newProjectsMap.values()];

updateProjectsDB(newProjects);
setProjects(newProjects);
};

/**
Expand All @@ -96,7 +100,10 @@ export function ProjectsProvider({children}: {children: ReactNode}) {
});
}

setProjects([...newProjectsMap.values()]);
const newProjects = [...newProjectsMap.values()];

updateProjectsDB(newProjects);
setProjects(newProjects);
};

/**
Expand Down

0 comments on commit 4b77e26

Please sign in to comment.