diff --git a/web/src/lib/managers/activity-manager.svelte.ts b/web/src/lib/managers/activity-manager.svelte.ts index ce6445753d..68e970109b 100644 --- a/web/src/lib/managers/activity-manager.svelte.ts +++ b/web/src/lib/managers/activity-manager.svelte.ts @@ -130,10 +130,10 @@ class ActivityManager { this.#likeCount--; } - if (index !== undefined) { - this.#activities.splice(index, 1); - } else { + if (index === undefined) { this.#activities = this.#activities.filter(({ id }) => id !== activity.id); + } else { + this.#activities.splice(index, 1); } await deleteActivity({ id: activity.id });