mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
fix: types of data center call
This commit is contained in:
@@ -9,7 +9,7 @@ import { StyledSettingH2 } from '../style';
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/ui/button';
|
||||
import Input from '@/ui/input';
|
||||
import { uploadBlob, Workspace, WorkspaceType } from '@affine/datacenter';
|
||||
import { getDataCenter, Workspace, WorkspaceType } from '@affine/datacenter';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { WorkspaceDetails } from '@/components/workspace-slider-bar/WorkspaceSelector/SelectorPopperContent';
|
||||
import { WorkspaceDelete } from './delete';
|
||||
@@ -74,9 +74,11 @@ export const GeneralPage = ({
|
||||
const fileChange = async (file: File) => {
|
||||
setUploading(true);
|
||||
const blob = new Blob([file], { type: file.type });
|
||||
const blobId = await uploadBlob({ blob }).finally(() => {
|
||||
setUploading(false);
|
||||
});
|
||||
const blobId = await getDataCenter()
|
||||
.then(dc => dc.apis.uploadBlob({ blob }))
|
||||
.finally(() => {
|
||||
setUploading(false);
|
||||
});
|
||||
if (blobId) {
|
||||
currentWorkspace?.meta.setAvatar(blobId);
|
||||
workspaces[workspace.id]?.meta.setAvatar(blobId);
|
||||
|
||||
Reference in New Issue
Block a user