From 8cc496ab968c80601680793801d52285259988bc Mon Sep 17 00:00:00 2001 From: Norris Ng <103449568+norrisng-bc@users.noreply.github.com> Date: Wed, 27 Dec 2023 10:47:34 -0800 Subject: [PATCH] Poll userId before fetching buckets list Quick fix for race condition between getUserId and GET /bucket --- frontend/src/components/bucket/BucketList.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/components/bucket/BucketList.vue b/frontend/src/components/bucket/BucketList.vue index df21cb33..22ff6ce8 100644 --- a/frontend/src/components/bucket/BucketList.vue +++ b/frontend/src/components/bucket/BucketList.vue @@ -41,6 +41,11 @@ const closeBucketConfig = () => { }; onMounted(async () => { + while (!getUserId.value) { + await new Promise((r) => { + setTimeout(r, 500); + }); + } await bucketStore.fetchBuckets({ userId: getUserId.value, objectPerms: true }); });