From 794cd94db683ae6d12130e2f980a36b785f68b71 Mon Sep 17 00:00:00 2001 From: benweet Date: Tue, 21 Nov 2017 08:17:41 +0000 Subject: [PATCH] Fixed content unload on reset --- src/store/data.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/store/data.js b/src/store/data.js index 597a78fc..b4faed1e 100644 --- a/src/store/data.js +++ b/src/store/data.js @@ -158,7 +158,13 @@ module.actions.setTemplates = ({ commit }, data) => { // Last opened module.getters.lastOpened = getter('lastOpened'); module.getters.lastOpenedIds = (state, getters, rootState) => { - const lastOpened = getters.lastOpened; + const lastOpened = { + ...getters.lastOpened, + }; + const currentFileId = rootState.file.currentId; + if (currentFileId && !lastOpened[currentFileId]) { + lastOpened[currentFileId] = Date.now(); + } return Object.keys(lastOpened) .filter(id => rootState.file.itemMap[id]) .sort((id1, id2) => lastOpened[id2] - lastOpened[id1])