Skip to content

Commit

Permalink
Merge pull request #1442 from kubeshop/andreiv1992/fix/monokle-config…
Browse files Browse the repository at this point in the history
…-changes-not-picked-up-new-project

fix: edge case when new project is created
  • Loading branch information
andreivinaga authored Mar 7, 2022
2 parents 3be242d + edd2d98 commit bf4e7d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/global-electron-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ interface ElectronStoreChangePropagate<P, T> {
const projectNameChange: ElectronStoreChangePropagate<Project[], ProjectNameChange> = {
keyName: 'appConfig.projects',
action: (newProjects, oldProjects) => {
// means that a new project has been created and we should not update that
if (newProjects.length > oldProjects.length) {
return { shouldTriggerAcrossWindows: false };
}

const triggeredForProject = newProjects
.find((project, index) => project.name !== oldProjects[index].name);
if (!triggeredForProject) {
Expand Down

0 comments on commit bf4e7d0

Please sign in to comment.