refactor: 画面サイズのしきい値をconstにまとめる

This commit is contained in:
kakkokari-gtyih
2024-06-25 20:04:59 +09:00
parent e88fc369d9
commit 05ca36f400
9 changed files with 17 additions and 15 deletions

View File

@@ -2,6 +2,7 @@
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { MOBILE_THRESHOLD } from "@/const.js";
type ScrollBehavior = 'auto' | 'smooth' | 'instant';
@@ -110,7 +111,7 @@ export function scrollToBottom(
container.scroll({ top: el.scrollHeight - container.clientHeight + getStickyTop(el, container) || 0, ...options });
} else {
window.scroll({
top: (el.scrollHeight - window.innerHeight + getStickyTop(el, container) + (window.innerWidth <= 500 ? 96 : 0)) || 0,
top: (el.scrollHeight - window.innerHeight + getStickyTop(el, container) + (window.innerWidth <= MOBILE_THRESHOLD ? 96 : 0)) || 0,
...options,
});
}