From fa2b900ff3c1e2b5f5ced40bd1c94c6d92dbee24 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Wed, 8 Feb 2023 17:23:20 +0900 Subject: [PATCH] feat: (friendly) Adjusted so that the account switching modal appears when you press and hold the timeline button on the bottom navigation bar, Add refresh button to account switch modal --- CHANGELOG_CHERRYPICK.md | 2 ++ packages/frontend/src/account.ts | 5 +++++ packages/frontend/src/ui/friendly.vue | 21 +++++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 6aaa105ef2..797bcda320 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -18,11 +18,13 @@ - 클라이언트: (friendly) 하단으로 스크롤하면 새 노트 알림의 위치가 자동으로 조정됨 - 클라이언트: (friendly) UI에 흐림 효과 사용 옵션을 비활성화하면 플로팅 버튼을 불투명하게 표시하도록 설정함 - 클라이언트: (friendly) UI 애니메이션 줄이기 옵션이 활성화된 경우 헤더와 플로팅 버튼의 전환 애니메이션을 비활성화함 +- 클라이언트: (friendly) 하단 내비게이션 바의 타임라인 버튼을 길게 누르면 계정 전환 모달이 뜨도록 조정 - 클라이언트: 기본 테마 색상 일부 변경 🎨 - 클라이언트: 모든 계정 로그아웃 버튼과 구분하기 쉽도록 로그아웃 아이콘이 변경됨 - 클라이언트: 새 노트 알림이 부드럽게 표시되도록 애니메이션 추가 - 클라이언트: UI 애니메이션 줄이기 옵션이 활성화된 경우 새 노트 알림의 애니메이션을 비활성화함 - 클라이언트: 노트를 작성할 때, 단축키로 공개 범위를 전환할 수 있음 +- 클라이언트: 계정 전환 모달에 새로고침 버튼 추가 ### Bugfixes - 클라이언트: (friendly) 타임라인이 아닌 페이지에서 헤더에 블러가 적용되는 문제 diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index f97359111d..038fd90fba 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -282,6 +282,11 @@ export async function openAccountMenu(opts: { signout(); }, danger: true, + }, { + type: 'button', + icon: 'ti ti-refresh', + text: i18n.ts.reload, + action: () => { location.reload(); }, }]], ev.currentTarget ?? ev.target, { align: 'left', }); diff --git a/packages/frontend/src/ui/friendly.vue b/packages/frontend/src/ui/friendly.vue index b10b227339..ec8bf9e1ac 100644 --- a/packages/frontend/src/ui/friendly.vue +++ b/packages/frontend/src/ui/friendly.vue @@ -24,7 +24,7 @@
- + @@ -99,7 +99,7 @@ import * as os from '@/os'; import { defaultStore } from '@/store'; import { navbarItemDef } from '@/navbar'; import { i18n } from '@/i18n'; -import { $i } from '@/account'; +import { $i, openAccountMenu as openAccountMenu_ } from '@/account'; import { Router } from '@/nirax'; import { mainRouter } from '@/router'; import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata'; @@ -128,6 +128,8 @@ let lastScrollPosition = $ref(0); let queue = $ref(0); +let longTouchNavHome = $ref(false); + let pageMetadata = $ref>(); const widgetsEl = $shallowRef(); const widgetsShowing = $ref(false); @@ -249,6 +251,21 @@ function queueUpdated(q: number): void { queue = q; } +function openAccountMenu(ev: MouseEvent) { + longTouchNavHome = true; + setTimeout(() => { + if (longTouchNavHome === true) { + openAccountMenu_({ + withExtraOperation: true, + }, ev); + } + }, 500); +} + +function closeAccountMenu() { + longTouchNavHome = false; +} + const wallpaper = miLocalStorage.getItem('wallpaper') != null;