-
+
diff --git a/packages/frontend/src/components/MkPostFormSimple.vue b/packages/frontend/src/components/MkPostFormSimple.vue
index 7f05f6849f..5d6fa7113b 100644
--- a/packages/frontend/src/components/MkPostFormSimple.vue
+++ b/packages/frontend/src/components/MkPostFormSimple.vue
@@ -204,7 +204,7 @@ const showForm = ref(false);
const posting = ref(false);
const posted = ref(false);
const text = ref(props.initialText ?? '');
-const files = ref(props.initialFiles ?? []);
+const files = ref(props.initialFiles ?? ([] as Misskey.entities.DriveFile[]));
const poll = ref
(null);
const event = ref<{
title: string;
@@ -774,6 +774,17 @@ async function post(ev?: MouseEvent) {
return;
}
+ if (defaultStore.state.showNoAltTextWarning && files.value.some((f) => f.comment == null || f.comment.length === 0)) {
+ const { canceled } = await os.confirm({
+ type: 'warning',
+ text: i18n.ts._altWarning.noAltWarning,
+ caption: i18n.ts._altWarning.noAltWarningDescription,
+ okText: i18n.ts.goBack,
+ cancelText: i18n.ts.thisPostMayBeAnnoyingIgnore,
+ });
+ if (!canceled) return;
+ }
+
if (ev) {
const el = (ev.currentTarget ?? ev.target) as HTMLElement | null;
diff --git a/packages/frontend/src/pages/settings/appearance.vue b/packages/frontend/src/pages/settings/appearance.vue
index b70799cebb..28b936e637 100644
--- a/packages/frontend/src/pages/settings/appearance.vue
+++ b/packages/frontend/src/pages/settings/appearance.vue
@@ -180,6 +180,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.showFixedPostFormInReplies }}{{ i18n.ts.showFixedPostFormInRepliesDescription }} CherryPick
{{ i18n.ts.allMediaNoteCollapse }} CherryPick
+ {{ i18n.ts.showNoAltWarning }}{{ i18n.ts.showNoAltWarningDescription }} CherryPick
{{ i18n.ts.alwaysShowCw }} CherryPick
{{ i18n.ts.showReplyTargetNoteInSemiTransparent }} CherryPick
@@ -330,6 +331,7 @@ const renoteQuoteButtonSeparation = computed(defaultStore.makeGetterSetter('reno
const showFixedPostFormInReplies = computed(defaultStore.makeGetterSetter('showFixedPostFormInReplies'));
const showingAnimatedImages = computed(defaultStore.makeGetterSetter('showingAnimatedImages'));
const allMediaNoteCollapse = computed(defaultStore.makeGetterSetter('allMediaNoteCollapse'));
+const showNoAltTextWarning = computed(defaultStore.makeGetterSetter('showNoAltTextWarning'));
const alwaysShowCw = computed(defaultStore.makeGetterSetter('alwaysShowCw'));
const showReplyTargetNoteInSemiTransparent = computed(defaultStore.makeGetterSetter('showReplyTargetNoteInSemiTransparent'));
const nsfwOpenBehavior = computed(defaultStore.makeGetterSetter('nsfwOpenBehavior'));
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts
index 5a62402ef0..33b0118e45 100644
--- a/packages/frontend/src/store.ts
+++ b/packages/frontend/src/store.ts
@@ -614,6 +614,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
+ showNoAltTextWarning: {
+ where: 'device',
+ default: true,
+ },
alwaysShowCw: {
where: 'device',
default: false,