Refresh unsorted and templates when files data changes

pull/1/head
yflory 8 years ago
parent 9b6c9e3891
commit 81259fc25f

@ -158,7 +158,7 @@ define([
if (!rt.proxy[Cryptpad.storageKey] || !Cryptpad.isArray(rt.proxy[Cryptpad.storageKey])) { if (!rt.proxy[Cryptpad.storageKey] || !Cryptpad.isArray(rt.proxy[Cryptpad.storageKey])) {
var oldStore = Cryptpad.getStore(true); var oldStore = Cryptpad.getStore(true);
oldStore.get(Cryptpad.storageKey, function (err, s) { oldStore.get(Cryptpad.storageKey, function (err, s) {
rt.proxy.filesData = s; rt.proxy[Cryptpad.storageKey] = s;
onReady(f, rt.proxy, Cryptpad.storageKey); onReady(f, rt.proxy, Cryptpad.storageKey);
}); });
return; return;

@ -1488,8 +1488,12 @@ define([
// Reload after a few ms to make sure all the change events have been received // Reload after a few ms to make sure all the change events have been received
onRefresh.refresh(); onRefresh.refresh();
} else if (path.length && path[0] === FILES_DATA) { } else if (path.length && path[0] === FILES_DATA) {
if (filesOp.isPathInHrefArray(currentPath)) {
onRefresh.refresh();
} else {
refreshFilesData(); refreshFilesData();
} }
}
module.resetTree(); module.resetTree();
return false; return false;
}).on('remove', [], function (o, p) { }).on('remove', [], function (o, p) {
@ -1547,7 +1551,7 @@ define([
var viewHash = APP.viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys); var viewHash = APP.viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys);
APP.hash = readOnly ? viewHash : editHash; 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; localStorage.FS_hash = editHash;
} }

Loading…
Cancel
Save