fix(dbfs): default view can be overwritten accidently (close #3330)

This commit is contained in:
Aaron Liu
2026-03-04 16:59:38 +08:00
parent 0be493c6e2
commit 0f2f35d7d4
3 changed files with 8 additions and 5 deletions

2
assets

Submodule assets updated: 8f98777045...a5ade06951

View File

@@ -30,12 +30,15 @@ var (
}
},
}
defaultView = &types.ExplorerView{
)
func getDefaultView() *types.ExplorerView {
return &types.ExplorerView{
PageSize: defaultPageSize,
View: "grid",
Thumbnail: true,
}
)
}
type (
File struct {
@@ -213,7 +216,7 @@ func (f *File) View() *types.ExplorerView {
current = current.Parent
}
return defaultView
return getDefaultView()
}
// UserRoot return the root file from user's view.

View File

@@ -147,5 +147,5 @@ func (n *sharedWithMeNavigator) GetView(ctx context.Context, file *File) *types.
if view, ok := n.user.Settings.FsViewMap[string(constants.FileSystemSharedWithMe)]; ok {
return &view
}
return defaultView
return getDefaultView()
}