summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-02-11 13:54:27 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-02-11 13:54:27 +0900
commit73a1372940050d2c8a240e2a22c080ee2175e013 (patch)
treedede6cde4dd441dd1b402c7b9721fb91ccd876a3 /packages/frontend/src/components
parentenhance(client): ヘッダー(MkPageHeader)関連 (#9869) (diff)
downloadsharkey-73a1372940050d2c8a240e2a22c080ee2175e013.tar.gz
sharkey-73a1372940050d2c8a240e2a22c080ee2175e013.tar.bz2
sharkey-73a1372940050d2c8a240e2a22c080ee2175e013.zip
enhance(client): 迷惑になる可能性のある投稿を行う前に警告を表示
Resolve #9862
Diffstat (limited to 'packages/frontend/src/components')
-rw-r--r--packages/frontend/src/components/MkDialog.vue2
-rw-r--r--packages/frontend/src/components/MkPostForm.vue30
2 files changed, 31 insertions, 1 deletions
diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue
index da4db63406..9690353432 100644
--- a/packages/frontend/src/components/MkDialog.vue
+++ b/packages/frontend/src/components/MkDialog.vue
@@ -32,7 +32,7 @@
<MkButton v-if="showCancelButton || input || select" inline @click="cancel">{{ cancelText ?? i18n.ts.cancel }}</MkButton>
</div>
<div v-if="actions" :class="$style.buttons">
- <MkButton v-for="action in actions" :key="action.text" inline :primary="action.primary" @click="() => { action.callback(); close(); }">{{ action.text }}</MkButton>
+ <MkButton v-for="action in actions" :key="action.text" inline :primary="action.primary" @click="() => { action.callback(); modal?.close(); }">{{ action.text }}</MkButton>
</div>
</div>
</MkModal>
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index a06bdecaa8..f15906c1c1 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -579,6 +579,36 @@ async function post(ev?: MouseEvent) {
os.popup(MkRippleEffect, { x, y }, {}, 'end');
}
+ const annoying =
+ text.includes('$[x2') ||
+ text.includes('$[x3') ||
+ text.includes('$[x4') ||
+ text.includes('$[scale') ||
+ text.includes('$[position');
+ if (annoying) {
+ const { canceled, result } = await os.actions({
+ type: 'warning',
+ text: i18n.ts.thisPostMayBeAnnoying,
+ actions: [{
+ value: 'home',
+ text: i18n.ts.thisPostMayBeAnnoyingHome,
+ primary: true,
+ }, {
+ value: 'cancel',
+ text: i18n.ts.thisPostMayBeAnnoyingCancel,
+ }, {
+ value: 'ignore',
+ text: i18n.ts.thisPostMayBeAnnoyingIgnore,
+ }],
+ });
+
+ if (canceled) return;
+ if (result === 'cancel') return;
+ if (result === 'home') {
+ visibility = 'home';
+ }
+ }
+
let postData = {
text: text === '' ? undefined : text,
fileIds: files.length > 0 ? files.map(f => f.id) : undefined,