Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 42c8f9f

Browse files
committed
🔨 Fix remove call item
Signed-off-by: Babak Khalkhali Shandiz <[email protected]>
1 parent e99d4ee commit 42c8f9f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

‎src/models.ts‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,11 @@ export class CallsModel {
416416
}
417417

418418
async remove(item: CallItem): Promise<void> {
419-
const roots = await this.roots;
420-
if (-1 !== roots.indexOf(item)) {
421-
del(roots, item);
422-
this._onDidChange.fire(this);
423-
return;
424-
}
425-
426-
if (!item.parent?.children)
419+
const isInRoot = -1 != (await this.roots).indexOf (item)
420+
const siblings = isInRoot ? await this.roots : item.parent?.children;
421+
if (!siblings)
427422
return;
428-
del(item.parent.children, item);
423+
del(siblings, item);
429424
this._onDidChange.fire(this);
430425
}
431426

0 commit comments

Comments
 (0)