From a2762e71ad8af68123bfb4a7e0cbf77d156c815f Mon Sep 17 00:00:00 2001 From: Eana Hufwe Date: Tue, 30 Jul 2024 23:48:27 +0000 Subject: [PATCH] fix(client): patch widget sidebar --- packages/client/src/ui/universal.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/client/src/ui/universal.vue b/packages/client/src/ui/universal.vue index 40c2085c9c..5c9cb1537f 100644 --- a/packages/client/src/ui/universal.vue +++ b/packages/client/src/ui/universal.vue @@ -237,13 +237,18 @@ const DESKTOP_THRESHOLD = 1100; const MOBILE_THRESHOLD = 500; // デスクトップでウィンドウを狭くしたときモバイルUIが表示されて欲しいことはあるので deviceKind === 'desktop' の判定は行わない -const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD); +const windowBlockSize = getComputedStyle(document.documentElement)[ + "writing-mode" +].startsWith("vertical") + ? window.innerHeight + : window.innerWidth; +const isDesktop = ref(windowBlockSize >= DESKTOP_THRESHOLD); const isMobile = ref( - deviceKind === "smartphone" || window.innerWidth <= MOBILE_THRESHOLD, + deviceKind === "smartphone" || windowBlockSize <= MOBILE_THRESHOLD, ); window.addEventListener("resize", () => { isMobile.value = - deviceKind === "smartphone" || window.innerWidth <= MOBILE_THRESHOLD; + deviceKind === "smartphone" || windowBlockSize <= MOBILE_THRESHOLD; }); const replaceChatButtonWithAccountButton =