From e0d31659d9a9039ccfc9fab99ab0bbc78b2db123 Mon Sep 17 00:00:00 2001 From: DiamondThree Date: Sun, 8 Jan 2023 19:15:25 +0800 Subject: [PATCH] fix: hooks error --- packages/app/src/providers/temporary-helper-provider.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/app/src/providers/temporary-helper-provider.tsx b/packages/app/src/providers/temporary-helper-provider.tsx index c0a4e939a0..5731646a15 100644 --- a/packages/app/src/providers/temporary-helper-provider.tsx +++ b/packages/app/src/providers/temporary-helper-provider.tsx @@ -84,13 +84,8 @@ export const TemporaryHelperProvider = ({ const newWorkspacesMeta = workspacesMeta.map( (workspace: Workspace) => { if (workspace.id === workspaceId) { - workspaceData.name && (workspace.name = workspaceData.name); - workspaceData.avatar && - (workspace.avatar = workspaceData.avatar); - workspaceData.type && (workspace.type = workspaceData.type); - workspaceData.isPublish && - (workspace.isPublish = workspaceData.isPublish); - return workspace; + const workspaceObj = Object.assign(workspace, workspaceData); + return workspaceObj; } return workspace; }