diff --git a/src/components/AnnounceSwitch.svelte b/src/components/AnnounceSwitch.svelte
new file mode 100644
index 000000000..3f8e42c27
--- /dev/null
+++ b/src/components/AnnounceSwitch.svelte
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Header.svelte b/src/components/Header.svelte
index a26385667..4710ed0bd 100644
--- a/src/components/Header.svelte
+++ b/src/components/Header.svelte
@@ -1,6 +1,7 @@
-
+
-
+
diff --git a/src/views/repo/Issue.svelte b/src/views/repo/Issue.svelte
index fd31a236a..c2ecfe077 100644
--- a/src/views/repo/Issue.svelte
+++ b/src/views/repo/Issue.svelte
@@ -16,6 +16,8 @@
} from "@app/lib/utils";
import { invoke } from "@tauri-apps/api/core";
+ import { announce } from "@app/components/AnnounceSwitch.svelte";
+
import Border from "@app/components/Border.svelte";
import CommentComponent from "@app/components/Comment.svelte";
import CommentToggleInput from "@app/components/CommentToggleInput.svelte";
@@ -36,7 +38,6 @@
export let issues: Issue[];
export let config: Config;
- const announce = false;
let topLevelReplyOpen = false;
// Close the comment textbox when switching between issues. The view doesn't
@@ -91,7 +92,7 @@
await invoke("create_issue_comment", {
rid: repo.rid,
new: { id: issue.id, body, embeds },
- opts: { announce },
+ opts: { announce: $announce },
});
} catch (error) {
console.error("Comment creation failed: ", error);
@@ -105,7 +106,7 @@
await invoke("create_issue_comment", {
rid: repo.rid,
new: { id: issue.id, body, embeds, replyTo },
- opts: { announce },
+ opts: { announce: $announce },
});
} catch (error) {
console.error("Comment reply creation failed", error);
@@ -125,7 +126,7 @@
body,
embeds,
},
- opts: { announce },
+ opts: { announce: $announce },
});
} catch (error) {
if (error instanceof Error) {
@@ -154,7 +155,7 @@
({ did }) => publicKeyFromDid(did) === publicKey,
),
},
- opts: { announce },
+ opts: { announce: $announce },
});
} catch (error) {
if (error instanceof Error) {