Commit 85ed0202 authored by Steven's avatar Steven

chore: fix user request cache

parent 745902e8
......@@ -23,11 +23,13 @@ const useUserV1Store = create<UserV1Store>()((set, get) => ({
return await requestCache.get(username);
}
const promise = userServiceClient.getUser({
username: username,
});
requestCache.set(username, promise);
const { user } = await promise;
const promisedUser = userServiceClient
.getUser({
username: username,
})
.then(({ user }) => user);
requestCache.set(username, promisedUser);
const user = await promisedUser;
if (!user) {
throw new Error("User not found");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment