Skip to content

Commit

Permalink
fix(wallet): fix indefinite loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
samsiegart committed Jan 24, 2022
1 parent a765d24 commit c58f07d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/wallet/ui/src/contexts/Application.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,14 @@ const Provider = ({ children }) => {
const [schemaActions, setSchemaActions] = useState(null);

const setBackend = backend => {
observeIterator(backend, {
updateState: schema => {
setSchemaActions(schema.actions);
observeIterator(schema.services, { updateState: setServices });
observeIterator(schema.offers, { updateState: setInbox });
observeIterator(schema.purses, { updateState: setPurses });
observeIterator(schema.dapps, { updateState: setDapps });
observeIterator(schema.contacts, { updateState: setContacts });
observeIterator(schema.payments, { updateState: setPayments });
observeIterator(schema.issuers, { updateState: setIssuers });
},
});
setSchemaActions(backend.actions);
observeIterator(backend.services, { updateState: setServices });
observeIterator(backend.offers, { updateState: setInbox });
observeIterator(backend.purses, { updateState: setPurses });
observeIterator(backend.dapps, { updateState: setDapps });
observeIterator(backend.contacts, { updateState: setContacts });
observeIterator(backend.payments, { updateState: setPayments });
observeIterator(backend.issuers, { updateState: setIssuers });
};

const [pendingPurseCreations, setPendingPurseCreations] = useReducer(
Expand Down

0 comments on commit c58f07d

Please sign in to comment.