Change the sidebar filter to match new patch state

When changing the state of a patch we want the sidebar filter to reflect
that, otherwise the patch just disappears from the sidebar unless the
user selected "show all states".
This commit is contained in:
Rūdolfs Ošiņš
2025-01-10 16:52:32 +01:00
committed by Sebastian Martinez
parent 32ca4dc48d
commit 63d1c87c7f
+12 -1
View File
@@ -49,12 +49,20 @@
}
/* eslint-disable prefer-const */
let { repo, patch, patches, revisions, config, status }: Props = $props();
let {
repo,
patch,
patches,
revisions,
config,
status: initialStatus,
}: Props = $props();
/* eslint-enable prefer-const */
let cursor = patches.cursor;
let more = patches.more;
let items = $state(patches.content);
let status = $state(initialStatus);
let editingTitle = $state(false);
let updatedTitle = $state("");
let labelSaveInProgress: boolean = $state(false);
@@ -238,6 +246,9 @@
},
opts: { announce: $nodeRunning && $announce },
});
if (initialStatus !== undefined) {
status = state["status"];
}
} catch (error) {
console.error("Changing patch state failed", error);
} finally {