From 8d182f93621ad0c224f6fe6bea59264a93a6079e Mon Sep 17 00:00:00 2001 From: benweet Date: Sat, 7 Oct 2017 12:36:10 +0100 Subject: [PATCH] Fixed cleanTrashAfter --- src/components/common/variables.scss | 2 +- src/services/localDbSvc.js | 9 +++------ src/services/utils.js | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/common/variables.scss b/src/components/common/variables.scss index 9ca71071..50dd150e 100644 --- a/src/components/common/variables.scss +++ b/src/components/common/variables.scss @@ -4,7 +4,7 @@ $line-height-base: 1.67; $line-height-title: 1.33; $font-size-monospace: 0.85em; $code-bg: rgba(0, 0, 0, 0.05); -$info-bg: transparentize(#ffb000, 0.85); +$info-bg: transparentize(#ffa000, 0.85); $code-border-radius: 2px; $link-color: #0c93e4; $error-color: #f20; diff --git a/src/services/localDbSvc.js b/src/services/localDbSvc.js index 4564be31..ce587017 100644 --- a/src/services/localDbSvc.js +++ b/src/services/localDbSvc.js @@ -321,12 +321,9 @@ localDbSvc.sync() (utils.lastOpened + utils.cleanTrashAfter < Date.now()) ) { // Clean files - store.getters['file/items'].forEach((file) => { - // If file is in the trash - if (file.parentId === 'trash') { - store.dispatch('deleteFile', file.id); - } - }); + store.getters['file/items'] + .filter(file => file.parentId === 'trash') // If file is in the trash + .forEach(file => store.dispatch('deleteFile', file.id)); } // watch file changing diff --git a/src/services/utils.js b/src/services/utils.js index 3c2a32a3..7ed9f261 100644 --- a/src/services/utils.js +++ b/src/services/utils.js @@ -41,7 +41,7 @@ export default { origin, oauth2RedirectUri: `${origin}/oauth2/callback`, lastOpened, - cleanTrashAfter: 7 * 1000, // 7 days + cleanTrashAfter: 7 * 24 * 60 * 60 * 1000, // 7 days types: [ 'contentState', 'syncedContent',