Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ichub committed Dec 15, 2023
1 parent c79c4c7 commit 3e30ce2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
10 changes: 2 additions & 8 deletions apps/passport-client/src/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,7 @@ export async function dispatch(
case "reset-passport":
return resetPassport(state, update);
case "load-after-login":
return loadAfterLogin(
state,
action.encryptionKey,
action.storage,
update
);
return loadAfterLogin(action.encryptionKey, action.storage, update);
case "set-modal":
return update({
modal: action.modal
Expand Down Expand Up @@ -501,7 +496,6 @@ async function removePCD(state: AppState, update: ZuUpdate, pcdId: string) {
}

async function loadAfterLogin(
state: AppState,
encryptionKey: string,
storage: StorageWithRevision,
update: ZuUpdate
Expand Down Expand Up @@ -532,7 +526,7 @@ async function loadAfterLogin(
!validateAndLogStateErrors(
userResponse.value,
identityPCD.claim.identity,
state.pcds
pcds
)
) {
update({ userInvalid: true });
Expand Down
12 changes: 5 additions & 7 deletions apps/passport-client/src/localstorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ export async function loadPCDs(): Promise<PCDCollection> {
serializedCollection ?? "{}"
);

// const validationErrors = validatePCDCollection(collection);
// if (validationErrors.errors.length > 0) {
// logAndUploadValidationErrors(validationErrors);
// throw new Error(
// "couldn't load PCDs\n:" + validationErrors.errors.join("\n")
// );
// }
if (validateAndLogStateErrors(undefined, undefined, collection, true)) {
console.log(
"PCD Collection failed to validate when loading from localstorage"
);
}

return collection;
}
Expand Down

0 comments on commit 3e30ce2

Please sign in to comment.