Skip to content

Commit

Permalink
[core] fix undefined.get
Browse files Browse the repository at this point in the history
fix #645
  • Loading branch information
devlikepro committed Nov 20, 2024
1 parent e669dfe commit 6a44c15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/manager.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { promiseTimeout, sleep } from '@waha/utils/promiseTimeout';
import { complete } from '@waha/utils/reactive/complete';
import { SwitchObservable } from '@waha/utils/reactive/SwitchObservable';
import { PinoLogger } from 'nestjs-pino';
import { Observable } from 'rxjs';
import { Observable, retry, share } from 'rxjs';
import { map } from 'rxjs/operators';

import { WhatsappConfigService } from '../config.service';
Expand Down Expand Up @@ -77,6 +77,14 @@ export class SessionManagerCore extends SessionManager {
this.sessionConfig = null;
const engineName = this.engineConfigService.getDefaultEngineName();
this.EngineClass = this.getEngine(engineName);

this.events2 = new DefaultMap<WAHAEvents, SwitchObservable<any>>(
(key) =>
new SwitchObservable((obs$) => {
return obs$.pipe(retry(), share());
}),
);

this.store = new LocalStoreCore(engineName.toLowerCase());
this.sessionAuthRepository = new LocalSessionAuthRepository(this.store);
this.startPredefinedSessions();
Expand Down

0 comments on commit 6a44c15

Please sign in to comment.