mirror of
https://github.com/cloudreve/cloudreve.git
synced 2026-03-13 09:24:07 +08:00
fix(dbfs): default view can be overwritten accidently (close #3330)
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 8f98777045...a5ade06951
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user