From 81259fc25fea454add0769cba670777494e3b10d Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 22 Dec 2016 17:20:05 +0100 Subject: [PATCH] Refresh unsorted and templates when files data changes --- customize.dist/fsStore.js | 2 +- www/file/main.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/customize.dist/fsStore.js b/customize.dist/fsStore.js index 81b2a9f05..ac4f47956 100644 --- a/customize.dist/fsStore.js +++ b/customize.dist/fsStore.js @@ -158,7 +158,7 @@ define([ if (!rt.proxy[Cryptpad.storageKey] || !Cryptpad.isArray(rt.proxy[Cryptpad.storageKey])) { var oldStore = Cryptpad.getStore(true); oldStore.get(Cryptpad.storageKey, function (err, s) { - rt.proxy.filesData = s; + rt.proxy[Cryptpad.storageKey] = s; onReady(f, rt.proxy, Cryptpad.storageKey); }); return; diff --git a/www/file/main.js b/www/file/main.js index 237c4c5c7..49a9a4598 100644 --- a/www/file/main.js +++ b/www/file/main.js @@ -1488,7 +1488,11 @@ define([ // Reload after a few ms to make sure all the change events have been received onRefresh.refresh(); } else if (path.length && path[0] === FILES_DATA) { - refreshFilesData(); + if (filesOp.isPathInHrefArray(currentPath)) { + onRefresh.refresh(); + } else { + refreshFilesData(); + } } module.resetTree(); return false; @@ -1547,7 +1551,7 @@ define([ var viewHash = APP.viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys); APP.hash = readOnly ? viewHash : editHash; - if (!readOnly && (!window.location.hash || !localStorage.FS_hash)) { + if (!readOnly && !localStorage.FS_hash && !Cryptpad.getUserHash() && !window.location.hash) { localStorage.FS_hash = editHash; }