From cf18184e268d6a313aeb0a64c440c4c6831b2d41 Mon Sep 17 00:00:00 2001 From: Benoit Schweblin Date: Thu, 15 Nov 2018 12:26:04 +0100 Subject: [PATCH] Fixed light mode auto-close --- src/services/tempFileSvc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/tempFileSvc.js b/src/services/tempFileSvc.js index 9910b110..76563c41 100644 --- a/src/services/tempFileSvc.js +++ b/src/services/tempFileSvc.js @@ -44,9 +44,9 @@ export default { // Sanitize file creations const lastCreated = {}; const fileItemsById = store.state.file.itemsById; - Object.entries(store.getters['data/lastCreated']).forEach(([id, createdOn]) => { + Object.entries(store.getters['data/lastCreated']).forEach(([id, value]) => { if (fileItemsById[id] && fileItemsById[id].parentId === 'temp') { - lastCreated[id] = createdOn; + lastCreated[id] = value; } }); @@ -57,7 +57,7 @@ export default { // Keep only the last 10 temp files created by other sites Object.entries(lastCreated) - .sort(([, createdOn1], [, createdOn2]) => createdOn2 - createdOn1) + .sort(([, value1], [, value2]) => value2.created - value1.created) .splice(10) .forEach(([id]) => { delete lastCreated[id];