Skip to content

Commit

Permalink
Fixes Studio-42#3689, fm.sync removes unavailable volumes.
Browse files Browse the repository at this point in the history
When a request is made to the server with the open command and tree=1,
the server must reply with a list of all volumes. If the server's
response does not include a volume ElFinder already knows about, that
volume should be treated as not available anymore and get removed
from the file explorer UI.
  • Loading branch information
awa-xima committed Dec 13, 2024
1 parent 7544918 commit c3f6c67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/elFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,8 @@ var elFinder = function(elm, opts, bootCallback) {
isBinary = (opts.options || {}).dataType === 'binary',
// current cmd is "open"
isOpen = (!opts.asNotOpen && cmd === 'open'),
// the tree option is enabled (for "open" command)
isTree = (data.tree === 1),
// call default fail callback (display error dialog) ?
deffail = !(isBinary || opts.preventDefault || opts.preventFail),
// call default success callback ?
Expand Down Expand Up @@ -2523,7 +2525,7 @@ var elFinder = function(elm, opts, bootCallback) {
},
actionTarget;

if (isOpen) {
if (isOpen && !isTree) {
pushLeafRoots('files');
} else if (cmd === 'tree') {
pushLeafRoots('tree');
Expand Down

0 comments on commit c3f6c67

Please sign in to comment.