-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(files): File type filter UI sync with filter state #49259
base: master
Are you sure you want to change the base?
Conversation
When changing the folder the filter will be re-mounted by the file list, so we need to pass the current state of the filter to the filter UI. Signed-off-by: Ferdinand Thiessen <[email protected]>
/backport to stable30 |
/compile |
Signed-off-by: nextcloud-command <[email protected]>
@@ -45,6 +45,10 @@ export default defineComponent({ | |||
}, | |||
|
|||
props: { | |||
preset: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preset: { | |
presets: { |
We should use either singular or plural everywhere to minimize confusion
@@ -142,7 +145,8 @@ class TypeFilter extends FileListFilter { | |||
} | |||
|
|||
public setPreset(presets?: ITypePreset[]) { | |||
this.currentPresets = presets | |||
this.currentPresets = presets ?? [] | |||
this.currentInstance!.$props.preset = presets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.currentInstance!.$props.preset = presets | |
this.currentInstance!.$props.preset = presets ?? [] |
The proptype is an array so we could do this and remove the || []
in FileListFilterType?
Summary
When changing the folder the filter will be re-mounted by the file list, so we need to pass the current state of the filter to the filter UI.
Checklist