feat: Added account logout menu to navigation bar

This commit is contained in:
NoriDev 2022-09-15 16:41:24 +09:00
parent 32da3d95d2
commit d73a4761bf
2 changed files with 15 additions and 0 deletions

View file

@ -31,6 +31,7 @@
- 클라이언트: 위젯 위치 변경 방식 개선
- 클라이언트: 네비게이션 바 편집 환경 개선
- 클라이언트: 로그인된 모든 계정을 로그아웃하는 기능 추가
- 클라이언트: 네비게이션 바에 계정 로그아웃 메뉴 추가
### Bugfixes
- 클라이언트: 채팅방에서 메시지를 입력하고 있을 때 움직이지 않는 온점(.)이 표시되는 문제

View file

@ -6,6 +6,7 @@ import { del, get, set } from '@/scripts/idb-proxy';
import { apiUrl } from '@/config';
import { waiting, api, popup, popupMenu, success, alert } from '@/os';
import { unisonReload, reloadChannel } from '@/scripts/unison-reload';
import * as os from '@/os';
// TODO: 他のタブと永続化されたstateを同期
@ -256,6 +257,19 @@ export async function openAccountMenu(opts: {
icon: 'fas fa-users',
text: i18n.ts.manageAccounts,
to: '/settings/accounts',
}, {
type: 'button',
icon: 'fas fa-sign-in-alt fa-flip-horizontal',
text: i18n.ts.logout,
action: async () => {
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.ts.logoutConfirm,
});
if (canceled) return;
signout();
},
danger: true,
}]], ev.currentTarget ?? ev.target, {
align: 'left',
});