Skip to content

Commit

Permalink
fix: realm db
Browse files Browse the repository at this point in the history
  • Loading branch information
sidmorizon committed Dec 25, 2024
1 parent 6f91271 commit 2157658
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/kit-bg/src/dbs/local/realm/RealmDBAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LocalDbAgentBase } from '../LocalDbAgentBase';

import { realmDBSchemasMap } from './schemas';

import type { RealmObjectBase } from './base/RealmObjectBase';
import type Realm from 'realm';
import type { ELocalDBStoreNames } from '../localDBStoreNames';
import type {
ILocalDBAgent,
Expand All @@ -35,7 +35,7 @@ import type {
ILocalDBWithTransactionTask,
IRealmDBSchemaMap,
} from '../types';
import type Realm from 'realm';
import type { RealmObjectBase } from './base/RealmObjectBase';

export class RealmDBAgent extends LocalDbAgentBase implements ILocalDBAgent {
constructor(realm: Realm) {
Expand Down Expand Up @@ -229,8 +229,13 @@ export class RealmDBAgent extends LocalDbAgentBase implements ILocalDBAgent {

const pairs = await this.buildRecordPairsFromIds(params);

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
await Promise.all(pairs.map(async (oldRecord) => updater(oldRecord[1]!)));
await Promise.all(
pairs.map(async (oldRecord) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const newRecord = await updater(oldRecord[1]!);
return newRecord;
}),
);
return Promise.resolve(undefined);
}

Expand Down

0 comments on commit 2157658

Please sign in to comment.