From 7190bd00c9dec5e0054cd52be05cc9f294485158 Mon Sep 17 00:00:00 2001 From: yupix Date: Fri, 27 Jan 2023 13:52:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20classic=E3=83=A2=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=A7=E3=83=86=E3=83=BC=E3=83=9E=E3=81=8C=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=95=E3=82=8C=E3=81=9F=E9=9A=9B=E5=85=83?= =?UTF-8?q?=E3=81=AB=E6=88=BB=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=20(#9669?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: classicモードでテーマが自動変更された際元に戻すように * docs: update CHANGELOG.md * fix: prefixを miux:ui_temp から ui_temp に変更 --- CHANGELOG.md | 5 +++++ packages/frontend/src/local-storage.ts | 1 + packages/frontend/src/ui/classic.vue | 2 ++ packages/frontend/src/ui/universal.vue | 9 +++++++++ 4 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e767c15df4..e236006afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ You should also include the user name that made the change. --> +## 13.x.x (unreleased) + +### Bugfixes +- Client: classicモード使用時にwindowサイズによってdefaultに変更された後に、windowサイズが元に戻ったらclassicに戻すように修正 #9669 + ## 13.2.4 (2023/01/27) ### Improvements - リモートカスタム絵文字表示時のパフォーマンスを改善 diff --git a/packages/frontend/src/local-storage.ts b/packages/frontend/src/local-storage.ts index 68dc9ebe41..e6b828696c 100644 --- a/packages/frontend/src/local-storage.ts +++ b/packages/frontend/src/local-storage.ts @@ -18,6 +18,7 @@ type Keys = 'useSystemFont' | 'fontSize' | 'ui' | + 'ui_temp' | 'locale' | 'localeVersion' | 'theme' | diff --git a/packages/frontend/src/ui/classic.vue b/packages/frontend/src/ui/classic.vue index dab4b9b274..a5c2f8ca23 100644 --- a/packages/frontend/src/ui/classic.vue +++ b/packages/frontend/src/ui/classic.vue @@ -124,6 +124,8 @@ function onAiClick(ev) { } if (window.innerWidth < 1024) { + const currentUI = miLocalStorage.getItem('ui') + miLocalStorage.setItem('ui_temp', currentUI || 'default'); miLocalStorage.setItem('ui', 'default'); location.reload(); } diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index babc232875..a9bb85ab6a 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -141,6 +141,15 @@ mainRouter.on('change', () => { document.documentElement.style.overflowY = 'scroll'; +if (window.innerWidth > 1024) { + const tempUI = miLocalStorage.getItem('ui_temp') + if (tempUI) { + miLocalStorage.setItem('ui', tempUI) + miLocalStorage.removeItem('ui_temp') + location.reload(); + } +} + defaultStore.ready.then(() => { if (defaultStore.state.widgets.length === 0) { defaultStore.set('widgets', [{