Skip to content

Commit

Permalink
fix(vault): remove top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
stmio committed Oct 6, 2024
1 parent 3aba8b7 commit fce84ce
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/client/pages/vault/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ document.addEventListener("DOMContentLoaded", async () => {
} else {
const user = JSON.parse(localStorage.getItem("user"));

const name = await api
.post("/users/name", {
email: session.identity,
deviceID: session.device,
})
.then((res) => res.data)
.catch((err) => console.log(err));

localStorage.setItem("user", JSON.stringify({ ...user, name: name }));
localStorage.setItem(
"user",
JSON.stringify({ ...user, name: await getUserName() })
);
}

await checkUserStatus();
Expand Down Expand Up @@ -215,6 +210,16 @@ function checkUserStatus() {
.catch((err) => console.log(err));
}

function getUserName() {
return api
.post("/users/name", {
email: session.identity,
deviceID: session.device,
})
.then((res) => res.data)
.catch((err) => err);
}

function getUserKeychainUUIDs() {
return api
.post("/users/keychains", {
Expand Down

0 comments on commit fce84ce

Please sign in to comment.