mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
perf(files): Check node type property instead of instance
Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
parent
52438f9254
commit
7a8d069907
1 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
|||
import type { TreeNode } from '../services/FolderTree.ts'
|
||||
|
||||
import PQueue from 'p-queue'
|
||||
import { Folder, Node, View, getNavigation } from '@nextcloud/files'
|
||||
import { FileType, Folder, Node, View, getNavigation } from '@nextcloud/files'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import { emit, subscribe } from '@nextcloud/event-bus'
|
||||
import { isSamePath } from '@nextcloud/paths'
|
||||
|
|
@ -99,21 +99,21 @@ const removeFolderViewSource = (source: string) => {
|
|||
}
|
||||
|
||||
const onCreateNode = (node: Node) => {
|
||||
if (!(node instanceof Folder)) {
|
||||
if (node.type !== FileType.Folder) {
|
||||
return
|
||||
}
|
||||
registerNodeView(node)
|
||||
}
|
||||
|
||||
const onDeleteNode = (node: Node) => {
|
||||
if (!(node instanceof Folder)) {
|
||||
if (node.type !== FileType.Folder) {
|
||||
return
|
||||
}
|
||||
removeFolderView(node)
|
||||
}
|
||||
|
||||
const onMoveNode = ({ node, oldSource }) => {
|
||||
if (!(node instanceof Folder)) {
|
||||
if (node.type !== FileType.Folder) {
|
||||
return
|
||||
}
|
||||
removeFolderViewSource(oldSource)
|
||||
|
|
|
|||
Loading…
Reference in a new issue