diff --git a/locales/index.d.ts b/locales/index.d.ts index 400fc7e584..e9911d0f49 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1097,6 +1097,7 @@ export interface Locale { "doYouAgree": string; "beSureToReadThisAsItIsImportant": string; "iHaveReadXCarefullyAndAgree": string; + "timelineBackTopBehavior": string; "_initialAccountSetting": { "accountCreated": string; "letsStartAccountSetup": string; @@ -1637,6 +1638,10 @@ export interface Locale { "dialog": string; "quiet": string; }; + "_timelineBackTopBehavior": { + "newest": string; + "next": string; + }; "_channel": { "create": string; "edit": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index e6b980a4d1..807f2d535a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1094,6 +1094,7 @@ expired: "期限切れ" doYouAgree: "同意しますか?" beSureToReadThisAsItIsImportant: "重要ですので必ずお読みください。" iHaveReadXCarefullyAndAgree: "「{x}」の内容をよく読み、同意します。" +timelineBackTopBehavior: "タイムラインのスクロールが先頭に戻った時の挙動" _initialAccountSetting: accountCreated: "アカウントの作成が完了しました!" @@ -1555,6 +1556,10 @@ _serverDisconnectedBehavior: dialog: "ダイアログで警告" quiet: "控えめに警告" +_timelineBackTopBehavior: + newest: "最新の投稿を表示" + next: "次の投稿を遡る" + _channel: create: "チャンネルを作成" edit: "チャンネルを編集" diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index 544b81ffea..71b47473c1 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -47,7 +47,7 @@ import MkButton from '@/components/MkButton.vue'; import { defaultStore } from '@/store'; import { MisskeyEntity } from '@/types/date-separated-list'; import { i18n } from '@/i18n'; -import { UAParser } from 'ua-parser-js'; +import { isWebKit } from '@/scripts/useragent'; const SECOND_FETCH_LIMIT = 30; const TOLERANCE = 6; @@ -94,8 +94,7 @@ function concatMapWithArray(map: MisskeyEntityMap, entities: MisskeyEntity[]): M return new Map([...map, ...arrayToEntries(entities)]); } -const ua = new UAParser(navigator.userAgent); -const isWebKit = ua.getEngine().name === 'WebKit'; +const timelineBackTopBehavior = computed(() => isWebKit() ? 'newest' : defaultStore.reactiveState.timelineBackTopBehavior.value);