Skip to content

Commit

Permalink
fix: defaultNetwork is null
Browse files Browse the repository at this point in the history
  • Loading branch information
N3TC4T committed Mar 22, 2024
1 parent fc81351 commit ca73f91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/store/models/schemas/v14/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ const CoreSchema = {

populate: (realm: Realm) => {
// get all networks
const networks = realm.objects('Network') as any;
const networks = realm.objects('Network');

const { defaultNetworkId } = NetworkConfig;
const selectedNetwork = networks.find((n: any) => n.id === defaultNetworkId);
const selectedNetwork = networks.find((n) => {
return n.networkId === defaultNetworkId;
});

realm.create('Core', {
network: selectedNetwork,
Expand Down

0 comments on commit ca73f91

Please sign in to comment.