From 149071c05a7f0cc2f1cd5f7d478a453959beba11 Mon Sep 17 00:00:00 2001 From: OB42 <19638906+OB42@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:14:39 +0200 Subject: [PATCH 1/2] Use data directly from api response instead of hook The set method from useState is not instant. In most cases this will cause the url to not be modified in the base. --- saas/app/pages/team-settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saas/app/pages/team-settings.tsx b/saas/app/pages/team-settings.tsx index 7932a8c5b..bc2f06d27 100644 --- a/saas/app/pages/team-settings.tsx +++ b/saas/app/pages/team-settings.tsx @@ -109,7 +109,7 @@ function TeamSettings({ store, isMobile, firstGridItem, teamRequired, teamSlug } await currentTeam.updateTheme({ name: newName, - avatarUrl: newAvatarUrl, + avatarUrl: responseFromApiServerForUpload.url, }); notify('You successfully uploaded new Team logo.'); From 9c12fd1fa75d29ef03102adcfd69939b541b7ed8 Mon Sep 17 00:00:00 2001 From: OB42 <19638906+OB42@users.noreply.github.com> Date: Sun, 9 Jul 2023 23:15:15 +0200 Subject: [PATCH 2/2] Use data directly from api response instead of hook --- saas/app/pages/your-settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saas/app/pages/your-settings.tsx b/saas/app/pages/your-settings.tsx index e5c27b692..85ff35484 100644 --- a/saas/app/pages/your-settings.tsx +++ b/saas/app/pages/your-settings.tsx @@ -114,7 +114,7 @@ function YourSettings({ store, isMobile, firstGridItem, teamRequired }: Props) { await currentUser.updateProfile({ name: newName, - avatarUrl: newAvatarUrl, + avatarUrl: responseFromApiServerForUpload.url, }); notify('You successfully uploaded new avatar.');