Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion website-next/components/common/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import localforage from 'localforage'
import { UTOPIA_BACKEND, THUMBNAIL_ENDPOINT, ASSET_ENDPOINT, BASE_URL } from './env-vars'
import {
UTOPIA_BACKEND,
THUMBNAIL_ENDPOINT,
ASSET_ENDPOINT,
BASE_URL,
IS_TEST_ENVIRONMENT,
} from './env-vars'
import type { ProjectListing } from './persistence'
import type { LoginState } from './user'
import {
Expand Down Expand Up @@ -88,6 +94,9 @@ export async function getLoginState(useCache: 'cache' | 'no-cache'): Promise<Log
let localForageAvailableResult: boolean | null = null

export async function isLocalForageAvailable(): Promise<boolean> {
if (IS_TEST_ENVIRONMENT) {
return false
}
if (localForageAvailableResult == null) {
const result = await localforage
.keys()
Expand Down