fix(push): fix TypeScript Map type inference error in OfflinePushService

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-10 04:50:11 -07:00
parent bc48be1c95
commit 978c534a7e
1 changed files with 6 additions and 8 deletions

View File

@ -35,7 +35,7 @@ export interface NotificationForPush {
@Injectable()
export class OfflinePushService implements OnModuleInit {
private readonly logger = new Logger(OfflinePushService.name);
private readonly providers: Map<string, PushProvider>;
private readonly providers: Map<string, PushProvider> = new Map();
constructor(
private readonly tokenRepo: DevicePushTokenRepository,
@ -45,13 +45,11 @@ export class OfflinePushService implements OnModuleInit {
private readonly oppo: OppoProvider,
private readonly vivo: VivoProvider,
) {
this.providers = new Map([
['FCM', fcm],
['HMS', hms],
['MI', xiaomi],
['OPPO', oppo],
['VIVO', vivo],
]);
this.providers.set('FCM', fcm);
this.providers.set('HMS', hms);
this.providers.set('MI', xiaomi);
this.providers.set('OPPO', oppo);
this.providers.set('VIVO', vivo);
}
onModuleInit(): void {