(enhance) 予約登録完了したことをわかりやすく

This commit is contained in:
kakkokari-gtyih 2023-11-09 22:22:26 +09:00
parent a0e9ebfb83
commit f65e85c319
3 changed files with 10 additions and 0 deletions

1
locales/index.d.ts vendored
View file

@ -2474,6 +2474,7 @@ export interface Locale {
"postTime": string;
"localTime": string;
"addSchedule": string;
"willBePostedAtX": string;
};
}
declare const locales: {

View file

@ -2362,3 +2362,4 @@ _schedulePost:
postTime: "時刻"
localTime: "端末に設定されているタイムゾーンの時刻で投稿されます。"
addSchedule: "予約設定"
willBePostedAtX: "このノートは{date}に投稿されます。"

View file

@ -111,6 +111,7 @@ import { formatTimeString } from '@/scripts/format-time-string.js';
import { Autocomplete } from '@/scripts/autocomplete.js';
import * as os from '@/os.js';
import { selectFiles } from '@/scripts/select-file.js';
import { dateTimeFormat } from '@/scripts/intl-const.js';
import { defaultStore, notePostInterruptors, postFormActions } from '@/store.js';
import MkInfo from '@/components/MkInfo.vue';
import { i18n } from '@/i18n.js';
@ -808,6 +809,13 @@ async function post(ev?: MouseEvent) {
claimAchievement('notes1');
}
poll = null;
if (postData.schedule?.expiresAt) {
const d = new Date(postData.schedule.expiresAt);
const str = dateTimeFormat.format(d);
os.toast(i18n.t('_schedulePost.willBePostedAtX', { date: str }));
}
const text = postData.text ?? '';
const lowerCase = text.toLowerCase();
if ((lowerCase.includes('love') || lowerCase.includes('❤')) && lowerCase.includes('misskey')) {