diff --git a/src/components/PatchStateButton.svelte b/src/components/PatchStateButton.svelte
new file mode 100644
index 000000000..91b64f1bb
--- /dev/null
+++ b/src/components/PatchStateButton.svelte
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+ {#snippet toggle(onclick)}
+
+ {/snippet}
+ {#snippet popover()}
+
+ !isEqual(a.state, patchState))}>
+ {#snippet item(action)}
+ {
+ selectedAction = action;
+ closeFocused();
+ }}>
+ {action.caption}
+
+ {/snippet}
+
+
+ {/snippet}
+
+
diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte
index fa9293347..591000089 100644
--- a/src/views/repo/Patch.svelte
+++ b/src/views/repo/Patch.svelte
@@ -34,6 +34,7 @@
import LabelInput from "@app/components/LabelInput.svelte";
import Layout from "./Layout.svelte";
import PatchStateBadge from "@app/components/PatchStateBadge.svelte";
+ import PatchStateButton from "@app/components/PatchStateButton.svelte";
import PatchTeaser from "@app/components/PatchTeaser.svelte";
import Sidebar from "@app/components/Sidebar.svelte";
@@ -220,6 +221,24 @@
await reload();
}
}
+
+ async function saveState(state: Patch["state"]) {
+ try {
+ await invoke("edit_patch", {
+ rid: repo.rid,
+ cobId: patch.id,
+ action: {
+ type: "lifecycle",
+ state,
+ },
+ opts: { announce: $nodeRunning && $announce },
+ });
+ } catch (error) {
+ console.error("Editing reactions failed", error);
+ } finally {
+ await reload();
+ }
+ }