Skip to content

Commit

Permalink
do not invalidate currentStudyId from cache (#2532)
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz authored Sep 8, 2021
1 parent 3502447 commit 6aa8d03
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions services/web/client/source/class/osparc/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ qx.Class.define("osparc.Application", {
osparc.auth.Manager.getInstance().validateToken()
.then(() => {
const studyId = urlFragment.nav[1];
osparc.store.Store.getInstance().setCurrentStudyId(studyId);
this.__loadMainPage();
this.__loadMainPage(studyId);
})
.catch(() => this.__loadLoginPage());
}
Expand All @@ -200,8 +199,7 @@ qx.Class.define("osparc.Application", {
if (["anonymous", "guest"].includes(data.role.toLowerCase())) {
this.__loadNodeViewerPage(studyId, viewerNodeId);
} else {
osparc.store.Store.getInstance().setCurrentStudyId(studyId);
this.__loadMainPage();
this.__loadMainPage(studyId);
}
});
}
Expand Down Expand Up @@ -333,10 +331,13 @@ qx.Class.define("osparc.Application", {
view.addListener("done", () => this.__restart(), this);
},

__loadMainPage: function() {
__loadMainPage: function(studyId = null) {
// Invalidate the entire cache
osparc.store.Store.getInstance().invalidate();

if (studyId) {
osparc.store.Store.getInstance().setCurrentStudyId(studyId);
}
this.__connectWebSocket();
const mainPage = this.__mainPage = new osparc.desktop.MainPage();
this.__loadView(mainPage);
Expand Down

0 comments on commit 6aa8d03

Please sign in to comment.