Skip to content

Commit

Permalink
fix: ignore duplicate email error
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoung19 committed Dec 21, 2024
1 parent 64be4a1 commit b7d59ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion popup/pages/CloudPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ export const CloudPage = () => {
{settings._email === null ? (
<form
onSubmit={handleSubmit(async ({ email }) => {
await Promise.all([
const results = await Promise.allSettled([
setSettings({ ...settings, _email: email }),
db.transact(db.tx.emails[id()]!.update({ value: email })),
]);

for (const result of results) {
if (result.status === "rejected") {
console.log(result.reason);
}
}

reset({ email });
})}
>
Expand Down

0 comments on commit b7d59ee

Please sign in to comment.