From 8f956f4978a328387ae341046f111662b24423f0 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 11 Jan 2024 01:21:21 +0000 Subject: [PATCH] refactor (client): replace confusing expressions like $i != null --- packages/client/src/account.ts | 3 --- .../client/src/components/MkFollowButton.vue | 4 +-- packages/client/src/components/MkMention.vue | 5 ++-- packages/client/src/components/MkNote.vue | 6 ++--- packages/client/src/components/MkNoteSub.vue | 4 +-- .../MkPushNotificationAllowButton.vue | 15 +++++++---- .../components/MkReactionsViewer.reaction.vue | 4 +-- .../src/components/MkReactionsViewer.vue | 4 +-- .../client/src/components/MkRenoteButton.vue | 4 +-- packages/client/src/components/MkTimeline.vue | 4 +-- .../src/components/MkTutorialDialog.vue | 12 +++------ packages/client/src/components/MkUserInfo.vue | 8 ++++-- packages/client/src/init.ts | 6 ++--- packages/client/src/navbar.ts | 16 +++++------ packages/client/src/pages/about.vue | 6 ++--- packages/client/src/pages/admin-file.vue | 8 +++--- packages/client/src/pages/announcements.vue | 8 ++++-- packages/client/src/pages/auth.vue | 8 +++--- packages/client/src/pages/clip.vue | 4 +-- packages/client/src/pages/explore.users.vue | 10 +++---- packages/client/src/pages/gallery/post.vue | 8 +++--- packages/client/src/pages/instance-info.vue | 13 +++++---- packages/client/src/pages/page.vue | 7 +++-- .../src/pages/settings/account-info.vue | 6 ++--- packages/client/src/pages/settings/drive.vue | 6 ++--- .../pages/settings/preferences-backups.vue | 4 +-- packages/client/src/pages/timeline.vue | 18 ++++++++----- packages/client/src/pages/user-info.vue | 27 +++++++++---------- packages/client/src/pages/user/home.vue | 16 +++++------ packages/client/src/pages/user/index.vue | 4 +-- packages/client/src/pizzax.ts | 16 +++++------ packages/client/src/reactiveAccount.ts | 4 +++ packages/client/src/router.ts | 18 +++---------- packages/client/src/scripts/get-note-menu.ts | 27 +++++++++---------- packages/client/src/scripts/get-user-menu.ts | 15 +++++------ packages/client/src/scripts/please-login.ts | 4 +-- .../client/src/scripts/use-note-capture.ts | 10 +++---- packages/client/src/theme-store.ts | 6 ++--- packages/client/src/ui/_common_/common.vue | 4 +-- .../src/ui/_common_/navbar-for-mobile.vue | 3 ++- packages/client/src/ui/_common_/navbar.vue | 6 ++--- packages/client/src/ui/deck.vue | 2 +- packages/client/src/ui/deck/tl-column.vue | 7 +++-- 43 files changed, 184 insertions(+), 186 deletions(-) diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index 562a9e5422..f2187dff9d 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -12,9 +12,6 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload"; export type Account = firefish.entities.MeDetailed; -export const iAmModerator = $i != null && ($i.isAdmin || $i.isModerator); -export const iAmAdmin = $i?.isAdmin; - export async function signout() { waiting(); localStorage.removeItem("account"); diff --git a/packages/client/src/components/MkFollowButton.vue b/packages/client/src/components/MkFollowButton.vue index 035847480f..321d7ac3bf 100644 --- a/packages/client/src/components/MkFollowButton.vue +++ b/packages/client/src/components/MkFollowButton.vue @@ -8,7 +8,7 @@