Fixed light mode auto-close

This commit is contained in:
Benoit Schweblin 2018-11-15 12:26:04 +01:00
parent daadae1720
commit cf18184e26

View File

@ -44,9 +44,9 @@ export default {
// Sanitize file creations // Sanitize file creations
const lastCreated = {}; const lastCreated = {};
const fileItemsById = store.state.file.itemsById; 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') { 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 // Keep only the last 10 temp files created by other sites
Object.entries(lastCreated) Object.entries(lastCreated)
.sort(([, createdOn1], [, createdOn2]) => createdOn2 - createdOn1) .sort(([, value1], [, value2]) => value2.created - value1.created)
.splice(10) .splice(10)
.forEach(([id]) => { .forEach(([id]) => {
delete lastCreated[id]; delete lastCreated[id];