mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
fix(files): Ensure the filter instance is mounted
`reset` could be called before the filters are mounted, in this case it is valid to update the presets, but we must not try to access the vue instance (as it does not exist yet). Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
87813cd647
commit
a673547397
2 changed files with 7 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ class HiddenFilesFilter extends FileListFilter {
|
|||
|
||||
constructor() {
|
||||
super('files:hidden', 0)
|
||||
this.showHidden = loadState<UserConfig>('files', 'config', { show_hidden: false }).show_hidden
|
||||
this.showHidden = loadState<Partial<UserConfig>>('files', 'config', { show_hidden: false }).show_hidden
|
||||
|
||||
subscribe('files:config:updated', ({ key, value }) => {
|
||||
if (key === 'show_hidden') {
|
||||
|
|
|
|||
|
|
@ -149,7 +149,12 @@ class TypeFilter extends FileListFilter {
|
|||
|
||||
public setPresets(presets?: ITypePreset[]) {
|
||||
this.currentPresets = presets ?? []
|
||||
this.currentInstance!.$props.presets = presets
|
||||
if (this.currentInstance !== undefined) {
|
||||
// could be called before the instance was created
|
||||
// (meaning the files list is not mounted yet)
|
||||
this.currentInstance.$props.presets = presets
|
||||
}
|
||||
|
||||
this.filterUpdated()
|
||||
|
||||
const chips: IFileListFilterChip[] = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue