Skip to content

Commit

Permalink
Merge branch 'master' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
SLOBS-Release committed Apr 9, 2024
2 parents 4b745c8 + 5260b09 commit 7ee13de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/services/realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ export class RealmObject {
const val = this.realmModel[key] as unknown;

if (val instanceof Realm.Object) {
const klass = RealmService.registeredClasses[this.schema.properties[key].type];

const dataType = this.schema.properties[key];
// Realm type can be either a string or a nested object with a `type` property
const type = typeof dataType === 'string' ? dataType : dataType.type;
const klass = RealmService.registeredClasses[type];
return klass.fromRealmModel(val);
}

Expand Down

0 comments on commit 7ee13de

Please sign in to comment.