Add announce preference to settings

This commit is contained in:
Rūdolfs Ošiņš
2024-10-25 10:46:53 +02:00
parent c01a48939e
commit 0693f4f806
4 changed files with 138 additions and 32 deletions
+6 -5
View File
@@ -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) {