Vuex: clear project variables if project not found

This commit is contained in:
D. Berge
2023-08-23 19:30:52 +02:00
parent 1f9c0e56fe
commit 62f90846a8

View File

@@ -8,6 +8,10 @@ async function getProject ({commit, dispatch}, projectId) {
const recentProjects = JSON.parse(localStorage.getItem("recentProjects") || "[]")
recentProjects.unshift(res);
localStorage.setItem("recentProjects", JSON.stringify(recentProjects.slice(0, 3)));
} else {
commit('setProjectName', null);
commit('setProjectId', null);
commit('setProjectSchema', null);
}
}