diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-01 13:42:40 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-01 13:42:40 +0900 |
| commit | c823cbe63b30d622d240adb92b696d0f507d084d (patch) | |
| tree | 1d2dadb135abd92e02b04281fd6224b4b1376054 /packages/frontend/src/ui | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | misskey-c823cbe63b30d622d240adb92b696d0f507d084d.tar.gz misskey-c823cbe63b30d622d240adb92b696d0f507d084d.tar.bz2 misskey-c823cbe63b30d622d240adb92b696d0f507d084d.zip | |
refactor(frontend): remove $store
Diffstat (limited to 'packages/frontend/src/ui')
| -rw-r--r-- | packages/frontend/src/ui/_common_/common.vue | 11 | ||||
| -rw-r--r-- | packages/frontend/src/ui/_common_/stream-indicator.vue | 3 | ||||
| -rw-r--r-- | packages/frontend/src/ui/classic.header.vue | 6 | ||||
| -rw-r--r-- | packages/frontend/src/ui/classic.sidebar.vue | 8 | ||||
| -rw-r--r-- | packages/frontend/src/ui/classic.vue | 6 | ||||
| -rw-r--r-- | packages/frontend/src/ui/deck.vue | 17 | ||||
| -rw-r--r-- | packages/frontend/src/ui/universal.vue | 32 | ||||
| -rw-r--r-- | packages/frontend/src/ui/visitor/a.vue | 5 | ||||
| -rw-r--r-- | packages/frontend/src/ui/visitor/b.vue | 4 |
9 files changed, 50 insertions, 42 deletions
diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue index 976345f9ee..e1561cb396 100644 --- a/packages/frontend/src/ui/_common_/common.vue +++ b/packages/frontend/src/ui/_common_/common.vue @@ -11,11 +11,11 @@ <TransitionGroup tag="div" :class="$style.notifications" - :move-class="$store.state.animation ? $style.transition_notification_move : ''" - :enter-active-class="$store.state.animation ? $style.transition_notification_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_notification_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_notification_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_notification_leaveTo : ''" + :move-class="defaultStore.state.animation ? $style.transition_notification_move : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_notification_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_notification_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_notification_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_notification_leaveTo : ''" > <XNotification v-for="notification in notifications" :key="notification.id" :notification="notification" :class="$style.notification"/> </TransitionGroup> @@ -40,6 +40,7 @@ import * as sound from '@/scripts/sound'; import { $i } from '@/account'; import { stream } from '@/stream'; import { i18n } from '@/i18n'; +import { defaultStore } from '@/store'; const XStreamIndicator = defineAsyncComponent(() => import('./stream-indicator.vue')); const XUpload = defineAsyncComponent(() => import('./upload.vue')); diff --git a/packages/frontend/src/ui/_common_/stream-indicator.vue b/packages/frontend/src/ui/_common_/stream-indicator.vue index b46422d6cd..2a856e2a45 100644 --- a/packages/frontend/src/ui/_common_/stream-indicator.vue +++ b/packages/frontend/src/ui/_common_/stream-indicator.vue @@ -1,5 +1,5 @@ <template> -<div v-if="hasDisconnected && $store.state.serverDisconnectedBehavior === 'quiet'" :class="$style.root" class="_panel _shadow" @click="resetDisconnected"> +<div v-if="hasDisconnected && defaultStore.state.serverDisconnectedBehavior === 'quiet'" :class="$style.root" class="_panel _shadow" @click="resetDisconnected"> <div><i class="ti ti-alert-triangle"></i> {{ i18n.ts.disconnectedFromServer }}</div> <div :class="$style.command" class="_buttons"> <MkButton :class="$style.commandButton" small primary @click="reload">{{ i18n.ts.reload }}</MkButton> @@ -14,6 +14,7 @@ import { stream } from '@/stream'; import { i18n } from '@/i18n'; import MkButton from '@/components/MkButton.vue'; import * as os from '@/os'; +import { defaultStore } from '@/store'; const zIndex = os.claimZIndex('high'); diff --git a/packages/frontend/src/ui/classic.header.vue b/packages/frontend/src/ui/classic.header.vue index 3dfb371d32..6d331ceb37 100644 --- a/packages/frontend/src/ui/classic.header.vue +++ b/packages/frontend/src/ui/classic.header.vue @@ -50,6 +50,7 @@ import { navbarItemDef } from '@/navbar'; import { openAccountMenu } from '@/account'; import MkButton from '@/components/MkButton.vue'; import { mainRouter } from '@/router'; +import { defaultStore } from '@/store'; export default defineComponent({ components: { @@ -63,12 +64,13 @@ export default defineComponent({ connection: null, navbarItemDef: navbarItemDef, settingsWindowed: false, + defaultStore, }; }, computed: { menu(): string[] { - return this.$store.state.menu; + return defaultStore.state.menu; }, otherNavItemIndicated(): boolean { @@ -81,7 +83,7 @@ export default defineComponent({ }, watch: { - '$store.reactiveState.menuDisplay.value'() { + 'defaultStore.reactiveState.menuDisplay.value'() { this.calcViewState(); }, }, diff --git a/packages/frontend/src/ui/classic.sidebar.vue b/packages/frontend/src/ui/classic.sidebar.vue index 6fff233ac5..30ec0dc295 100644 --- a/packages/frontend/src/ui/classic.sidebar.vue +++ b/packages/frontend/src/ui/classic.sidebar.vue @@ -51,6 +51,7 @@ import MkButton from '@/components/MkButton.vue'; import { StickySidebar } from '@/scripts/sticky-sidebar'; import { mainRouter } from '@/router'; //import MisskeyLogo from '@assets/client/misskey.svg'; +import { defaultStore } from '@/store'; export default defineComponent({ components: { @@ -66,12 +67,13 @@ export default defineComponent({ navbarItemDef: navbarItemDef, iconOnly: false, settingsWindowed: false, + defaultStore, }; }, computed: { menu(): string[] { - return this.$store.state.menu; + return this.defaultStore.state.menu; }, otherNavItemIndicated(): boolean { @@ -84,7 +86,7 @@ export default defineComponent({ }, watch: { - '$store.reactiveState.menuDisplay.value'() { + 'defaultStore.reactiveState.menuDisplay.value'() { this.calcViewState(); }, @@ -111,7 +113,7 @@ export default defineComponent({ openInstanceMenu, calcViewState() { - this.iconOnly = (window.innerWidth <= 1400) || (this.$store.state.menuDisplay === 'sideIcon'); + this.iconOnly = (window.innerWidth <= 1400) || (this.defaultStore.state.menuDisplay === 'sideIcon'); this.settingsWindowed = (window.innerWidth > 1400); }, diff --git a/packages/frontend/src/ui/classic.vue b/packages/frontend/src/ui/classic.vue index a359463d9b..4838272a9e 100644 --- a/packages/frontend/src/ui/classic.vue +++ b/packages/frontend/src/ui/classic.vue @@ -21,7 +21,7 @@ </div> </div> - <Transition :name="$store.state.animation ? 'tray-back' : ''"> + <Transition :name="defaultStore.state.animation ? 'tray-back' : ''"> <div v-if="widgetsShowing" class="tray-back _modalBg" @@ -30,11 +30,11 @@ ></div> </Transition> - <Transition :name="$store.state.animation ? 'tray' : ''"> + <Transition :name="defaultStore.state.animation ? 'tray' : ''"> <XWidgets v-if="widgetsShowing" class="tray"/> </Transition> - <iframe v-if="$store.state.aiChanMode" ref="live2d" class="ivnzpscs" src="https://misskey-dev.github.io/mascot-web/?scale=2&y=1.4"></iframe> + <iframe v-if="defaultStore.state.aiChanMode" ref="live2d" class="ivnzpscs" src="https://misskey-dev.github.io/mascot-web/?scale=2&y=1.4"></iframe> <XCommon/> </div> diff --git a/packages/frontend/src/ui/deck.vue b/packages/frontend/src/ui/deck.vue index be168b4282..4db7c9413a 100644 --- a/packages/frontend/src/ui/deck.vue +++ b/packages/frontend/src/ui/deck.vue @@ -53,10 +53,10 @@ </div> <Transition - :enter-active-class="$store.state.animation ? $style.transition_menuDrawerBg_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''" > <div v-if="drawerMenuShowing" @@ -68,10 +68,10 @@ </Transition> <Transition - :enter-active-class="$store.state.animation ? $style.transition_menuDrawer_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_menuDrawer_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_menuDrawer_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_menuDrawer_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_menuDrawer_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_menuDrawer_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_menuDrawer_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_menuDrawer_leaveTo : ''" > <div v-if="drawerMenuShowing" :class="$style.menu"> <XDrawerMenu/> @@ -99,6 +99,7 @@ import { i18n } from '@/i18n'; import { mainRouter } from '@/router'; import { unisonReload } from '@/scripts/unison-reload'; import { deviceKind } from '@/scripts/device-kind'; +import { defaultStore } from '@/store'; const XStatusBars = defineAsyncComponent(() => import('@/ui/_common_/statusbars.vue')); mainRouter.navHook = (path, flag): boolean => { diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index 11d1c85e38..ab3d01532b 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -27,10 +27,10 @@ </div> <Transition - :enter-active-class="$store.state.animation ? $style.transition_menuDrawerBg_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_menuDrawerBg_leaveTo : ''" > <div v-if="drawerMenuShowing" @@ -42,10 +42,10 @@ </Transition> <Transition - :enter-active-class="$store.state.animation ? $style.transition_menuDrawer_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_menuDrawer_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_menuDrawer_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_menuDrawer_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_menuDrawer_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_menuDrawer_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_menuDrawer_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_menuDrawer_leaveTo : ''" > <div v-if="drawerMenuShowing" :class="$style.menuDrawer"> <XDrawerMenu/> @@ -53,10 +53,10 @@ </Transition> <Transition - :enter-active-class="$store.state.animation ? $style.transition_widgetsDrawerBg_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_widgetsDrawerBg_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_widgetsDrawerBg_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_widgetsDrawerBg_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_widgetsDrawerBg_leaveTo : ''" > <div v-if="widgetsShowing" @@ -68,10 +68,10 @@ </Transition> <Transition - :enter-active-class="$store.state.animation ? $style.transition_widgetsDrawer_enterActive : ''" - :leave-active-class="$store.state.animation ? $style.transition_widgetsDrawer_leaveActive : ''" - :enter-from-class="$store.state.animation ? $style.transition_widgetsDrawer_enterFrom : ''" - :leave-to-class="$store.state.animation ? $style.transition_widgetsDrawer_leaveTo : ''" + :enter-active-class="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterActive : ''" + :leave-active-class="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveActive : ''" + :enter-from-class="defaultStore.state.animation ? $style.transition_widgetsDrawer_enterFrom : ''" + :leave-to-class="defaultStore.state.animation ? $style.transition_widgetsDrawer_leaveTo : ''" > <div v-if="widgetsShowing" :class="$style.widgetsDrawer"> <button class="_button" :class="$style.widgetsCloseButton" @click="widgetsShowing = false"><i class="ti ti-x"></i></button> diff --git a/packages/frontend/src/ui/visitor/a.vue b/packages/frontend/src/ui/visitor/a.vue index 023b7fdb94..272e03da6a 100644 --- a/packages/frontend/src/ui/visitor/a.vue +++ b/packages/frontend/src/ui/visitor/a.vue @@ -42,7 +42,7 @@ import XHeader from './header.vue'; import { host, instanceName } from '@/config'; import * as os from '@/os'; import MkButton from '@/components/MkButton.vue'; -import { ColdDeviceStorage } from '@/store'; +import { defaultStore, ColdDeviceStorage } from '@/store'; import { mainRouter } from '@/router'; const DESKTOP_THRESHOLD = 1100; @@ -66,6 +66,7 @@ export default defineComponent({ }, mainRouter, isDesktop: window.innerWidth >= DESKTOP_THRESHOLD, + defaultStore, }; }, @@ -74,7 +75,7 @@ export default defineComponent({ return { 'd': () => { if (ColdDeviceStorage.get('syncDeviceDarkMode')) return; - this.$store.set('darkMode', !this.$store.state.darkMode); + this.defaultStore.set('darkMode', !this.defaultStore.state.darkMode); }, 's': () => { mainRouter.push('/search'); diff --git a/packages/frontend/src/ui/visitor/b.vue b/packages/frontend/src/ui/visitor/b.vue index e2168768e8..fd13439326 100644 --- a/packages/frontend/src/ui/visitor/b.vue +++ b/packages/frontend/src/ui/visitor/b.vue @@ -24,7 +24,7 @@ </div> </div> - <Transition :name="$store.state.animation ? 'tray-back' : ''"> + <Transition :name="'tray-back'"> <div v-if="showMenu" class="menu-back _modalBg" @@ -33,7 +33,7 @@ ></div> </Transition> - <Transition :name="$store.state.animation ? 'tray' : ''"> + <Transition :name="'tray'"> <div v-if="showMenu" class="menu"> <MkA to="/" class="link" active-class="active"><i class="ti ti-home icon"></i>{{ $ts.home }}</MkA> <MkA v-if="isTimelineAvailable" to="/timeline" class="link" active-class="active"><i class="ti ti-message icon"></i>{{ $ts.timeline }}</MkA> |