Skip to content

Commit

Permalink
fix(app): don't wait for ceramic when patching stamps (passportxyz#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer authored Jun 13, 2023
1 parent a3fc8a8 commit 3f8a1e3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/context/ceramicContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -573,17 +573,19 @@ export const CeramicContextProvider = ({ children }: { children: any }) => {
const newPassport = await fetchPassport(database, true);

if (ceramicClient && newPassport) {
try {
const deleteProviderIds = stampPatches
.filter(({ credential }) => !credential)
.map(({ provider }) => provider);

if (deleteProviderIds.length) await ceramicClient.deleteStampIDs(deleteProviderIds);

await ceramicClient.setStamps(newPassport.stamps);
} catch (e) {
console.log("error patching ceramic stamps", e);
}
(async () => {
try {
const deleteProviderIds = stampPatches
.filter(({ credential }) => !credential)
.map(({ provider }) => provider);

if (deleteProviderIds.length) await ceramicClient.deleteStampIDs(deleteProviderIds);

await ceramicClient.setStamps(newPassport.stamps);
} catch (e) {
console.log("error patching ceramic stamps", e);
}
})();
}

if (dbAccessToken) {
Expand Down

0 comments on commit 3f8a1e3

Please sign in to comment.