This commit is contained in:
Zuzanna 2026-09-09 22:58:57 +02:00 committed by GitHub
commit e34f7a9908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 3 deletions

View File

@ -1274,6 +1274,10 @@ define([
var refresh = APP.refresh = function (cb, opt) {
var type = APP.store[FILTER_BY];
var path = type ? [FILTER, type, currentPath] : currentPath;
if (APP.newSharedFolder && priv.anonSFHref && opt) {
opt.sf = true;
}
APP.displayDirectory(path, undefined, () => {
refreshDeprecated();
if (typeof(cb) === "function") { cb(); }
@ -2763,6 +2767,7 @@ define([
path.forEach(function (p, idx) {
if (isTrash && [2,3].indexOf(idx) !== -1) { return; }
if (skipNext) { skipNext = false; return; }
if ( idx > 0 && p === ROOT && path[0] === SHARED_FOLDER ) { return; }
if (APP.newSharedFolder && priv.isEmbed && p === ROOT && !idx) { return; }
var name = p;
@ -4330,8 +4335,7 @@ define([
var $folderHeader = getFolderListHeader(true);
var $fileHeader = getFileListHeader(true);
var path = currentPath.slice(1);
var root = Util.find(data, path);
var root = Util.find(data, path) || {};
var realPath = [ROOT, SHARED_FOLDER].concat(path);
if (manager.hasSubfolder(root)) { $list.append($folderHeader); }
@ -4376,6 +4380,13 @@ define([
} else {
path = [ROOT];
}
} else if (APP.loggedIn && path[0] === 'sf') {
const key = Object.entries(proxy.drive.root).find(
([, value]) => value === Number(APP.newSharedFolder)
)?.[0];
path = ['root', String(key), 'root'];
}
if (APP.loggedIn && path[0] === FILES_DATA) {
@ -4623,6 +4634,10 @@ define([
// _displayDirectory(path, force);
// cb();
}
if (opt?.sf) {
path = ['sf', String(APP.newSharedFolder), 'root'];
}
updateSharedFolders(sframeChan, manager, files, folders, function () {
_displayDirectory(path, force);
fixTags();

View File

@ -2383,7 +2383,7 @@ define([
// If our channel was deleted from all of our drives, sitch back to full hash
// in the address bar
Cryptpad.padRpc.onChannelDeleted.reg(function (channel) {
if (channel !== secret.channel) { return; }
if (channel !== secret.channel || currentPad.app === 'drive') { return; }
Cryptpad.setTabHref(currentPad.href);
});