diff --git a/app/components/account/AccountHoverWrapper.vue b/app/components/account/AccountHoverWrapper.vue index e91f6ad163..90172100c1 100644 --- a/app/components/account/AccountHoverWrapper.vue +++ b/app/components/account/AccountHoverWrapper.vue @@ -21,7 +21,7 @@ const account = ref(props.account) watch( () => [props.account, props.handle, hovered.value] satisfies WatcherType, ([newAccount, newHandle, newVisible], oldProps) => { - if (!newVisible || process.test) + if (!newVisible || import.meta.test) return if (newAccount) { diff --git a/app/composables/masto/masto.ts b/app/composables/masto/masto.ts index 98e7d4c135..0a1cc42a09 100644 --- a/app/composables/masto/masto.ts +++ b/app/composables/masto/masto.ts @@ -134,7 +134,7 @@ export function useStreaming( stream.value = cb(streamingClient.value) }) - if (import.meta.client && !process.test) + if (import.meta.client && !import.meta.test) useNuxtApp().$pageLifecycle.addFrozenListener(cleanup) tryOnBeforeUnmount(() => isActive.value = false) diff --git a/app/composables/masto/statusDrafts.ts b/app/composables/masto/statusDrafts.ts index cb34916c3e..1c92aea295 100644 --- a/app/composables/masto/statusDrafts.ts +++ b/app/composables/masto/statusDrafts.ts @@ -7,7 +7,7 @@ import { STORAGE_KEY_DRAFTS } from '~/constants' const MENTION_REGEX = /^(@\S+\s?)+/ const CODE_BLOCK_REGEX = /```/g -export const currentUserDrafts = (import.meta.server || process.test) +export const currentUserDrafts = (import.meta.server || import.meta.test) ? computed(() => ({ home: [], dialog: [], intent: [], quote: [] })) : useUserLocalStorage(STORAGE_KEY_DRAFTS, () => ({ home: [], dialog: [], intent: [], quote: [] })) diff --git a/app/composables/users.ts b/app/composables/users.ts index 3c7b3d7829..865fa206c3 100644 --- a/app/composables/users.ts +++ b/app/composables/users.ts @@ -296,7 +296,7 @@ interface UseUserLocalStorageCache { * @param initial */ export function useUserLocalStorage(key: string, initial: () => T): Ref { - if (import.meta.server || process.test) + if (import.meta.server || import.meta.test) return shallowRef(initial()) // @ts-expect-error bind value to the function