summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/aiscript
diff options
context:
space:
mode:
authorYuriha <121590760+yuriha-chan@users.noreply.github.com>2023-12-09 13:14:51 +0900
committerGitHub <noreply@github.com>2023-12-09 13:14:51 +0900
commitdd332b3515fd5284c02e05cd7b5f02d82237b0e8 (patch)
tree6d8e3ff73751c3971b7df7e7e51af0083068033b /packages/frontend/src/scripts/aiscript
parentFix/vue import error on intellij (#12612) (diff)
downloadsharkey-dd332b3515fd5284c02e05cd7b5f02d82237b0e8.tar.gz
sharkey-dd332b3515fd5284c02e05cd7b5f02d82237b0e8.tar.bz2
sharkey-dd332b3515fd5284c02e05cd7b5f02d82237b0e8.zip
Misskey Playのノート投稿画面で「内容を隠す」を設定できるようにする (#12576)
* Add the content warning option in AiScript UI postFormButton * Fix initial CW in postFormButton --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/frontend/src/scripts/aiscript')
-rw-r--r--packages/frontend/src/scripts/aiscript/ui.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/aiscript/ui.ts b/packages/frontend/src/scripts/aiscript/ui.ts
index d326b956e8..75b9248432 100644
--- a/packages/frontend/src/scripts/aiscript/ui.ts
+++ b/packages/frontend/src/scripts/aiscript/ui.ts
@@ -121,6 +121,7 @@ export type AsUiPostFormButton = AsUiComponentBase & {
rounded?: boolean;
form?: {
text: string;
+ cw?: string;
};
};
@@ -128,6 +129,7 @@ export type AsUiPostForm = AsUiComponentBase & {
type: 'postForm';
form?: {
text: string;
+ cw?: string;
};
};
@@ -454,8 +456,11 @@ function getPostFormButtonOptions(def: values.Value | undefined, call: (fn: valu
const getForm = () => {
const text = form!.value.get('text');
utils.assertString(text);
+ const cw = form!.value.get('cw');
+ if (cw) utils.assertString(cw);
return {
text: text.value,
+ cw: cw?.value,
};
};
@@ -478,8 +483,11 @@ function getPostFormOptions(def: values.Value | undefined, call: (fn: values.VFn
const getForm = () => {
const text = form!.value.get('text');
utils.assertString(text);
+ const cw = form!.value.get('cw');
+ if (cw) utils.assertString(cw);
return {
text: text.value,
+ cw: cw?.value,
};
};