mirror of
https://github.com/cloudreve/cloudreve.git
synced 2026-06-28 06:46:08 +00:00
fix(fts): context menu inconsistently shown items caused by missing capability bits in file traversing (fix #3385)
This commit is contained in:
@@ -372,6 +372,10 @@ func (f *File) Recycle() {
|
||||
f.Parent = nil
|
||||
f.OwnerModel = nil
|
||||
f.IsUserRoot = false
|
||||
f.CapabilitiesBs = nil
|
||||
f.FileExtendedInfo = nil
|
||||
f.FileFolderSummary = nil
|
||||
f.disableView = false
|
||||
f.mu = nil
|
||||
|
||||
filePool.Put(f)
|
||||
|
||||
@@ -742,8 +742,14 @@ func (f *DBFS) TraverseFile(ctx context.Context, fileID int) (fs.File, error) {
|
||||
rootUri = newTrashUri(root.Name())
|
||||
}
|
||||
|
||||
navigator, err := f.getNavigator(ctx, rootUri)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get navigator for root file: %w", err)
|
||||
}
|
||||
|
||||
root.Path[pathIndexRoot] = rootUri
|
||||
root.Path[pathIndexUser] = rootUri
|
||||
file.CapabilitiesBs = navigator.Capabilities(false).Capability
|
||||
|
||||
return file, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user