fix(client): patch widget sidebar

This commit is contained in:
Eana Hufwe 2024-07-30 23:48:27 +00:00 committed by GitHub
parent f0337595f6
commit a2762e71ad

View file

@ -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 =