fix: use absolute path in gql client (#5454)

This commit is contained in:
DarkSky
2023-12-29 14:48:04 +08:00
committed by GitHub
parent 5a1065c646
commit 3082d63948
3 changed files with 15 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ import {
checkBlobSizesQuery,
deleteBlobMutation,
fetchWithTraceReport,
getBaseUrl,
listBlobsQuery,
setBlobMutation,
} from '@affine/graphql';
@@ -10,14 +11,6 @@ import { fetcher } from '@affine/graphql';
import type { BlobStorage } from '../../engine/blob';
import { bufferToBlob } from '../../utils/buffer-to-blob';
function getBaseUrl(): string {
if (environment.isDesktop) {
return runtimeConfig.serverUrlPrefix;
}
const { protocol, hostname, port } = window.location;
return `${protocol}//${hostname}${port ? `:${port}` : ''}`;
}
export const createAffineCloudBlobStorage = (
workspaceId: string
): BlobStorage => {