Merge pull request 'Organizations now load only once' (#38) from SEND002 into main
Some checks failed
ci/woodpecker/push/db Pipeline is pending
ci/woodpecker/push/frontend Pipeline is pending
ci/woodpecker/push/fx_ingestor Pipeline is pending
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/mntx_gateway Pipeline is pending
ci/woodpecker/push/nats Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline failed
ci/woodpecker/push/bff Pipeline failed
Some checks failed
ci/woodpecker/push/db Pipeline is pending
ci/woodpecker/push/frontend Pipeline is pending
ci/woodpecker/push/fx_ingestor Pipeline is pending
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/mntx_gateway Pipeline is pending
ci/woodpecker/push/nats Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline failed
ci/woodpecker/push/bff Pipeline failed
Reviewed-on: #38
This commit was merged in pull request #38.
This commit is contained in:
@@ -35,6 +35,8 @@ class OrganizationsProvider extends ChangeNotifier {
|
||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
||||
try {
|
||||
final orgs = await OrganizationService.list();
|
||||
// keep fetched organizations so _org can resolve against them
|
||||
_setResource(Resource(data: orgs, isLoading: true));
|
||||
// fetch stored org
|
||||
String? org = await SecureStorageService.get(Constants.currentOrgKey);
|
||||
// check stored org availability
|
||||
@@ -54,6 +56,7 @@ class OrganizationsProvider extends ChangeNotifier {
|
||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
||||
try {
|
||||
final org = await OrganizationService.loadByInvitation(invitationRef);
|
||||
_setResource(Resource(data: [org], isLoading: true));
|
||||
await setCurrentOrganization(org.id);
|
||||
_setResource(Resource(data: [org], isLoading: false));
|
||||
return org;
|
||||
|
||||
Reference in New Issue
Block a user