mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:41:09 +02:00
fix(planta-bot): make I18nService optional to diagnose DI issue
Also restore @Global() decorator to I18nModule while keeping global: true in DynamicModule config for consistency with other modules like CreditModule. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
fd30fdc620
commit
c480231128
2 changed files with 7 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Module, DynamicModule } from '@nestjs/common';
|
||||
import { Module, DynamicModule, Global } from '@nestjs/common';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
import { I18nService, I18N_OPTIONS } from './i18n.service';
|
||||
import { I18nOptions } from './types';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import {
|
||||
BaseMatrixService,
|
||||
|
|
@ -61,7 +61,7 @@ export class MatrixService extends BaseMatrixService implements CreditCommandsHo
|
|||
// Expose services for credit commands mixin (CreditCommandsHost interface)
|
||||
public sessionService: SessionService;
|
||||
public creditService: CreditService;
|
||||
public i18nService: I18nService;
|
||||
public i18nService!: I18nService;
|
||||
|
||||
constructor(
|
||||
configService: ConfigService,
|
||||
|
|
@ -69,13 +69,15 @@ export class MatrixService extends BaseMatrixService implements CreditCommandsHo
|
|||
private plantaService: PlantaService,
|
||||
sessionService: SessionService,
|
||||
creditService: CreditService,
|
||||
i18nService: I18nService
|
||||
@Optional() i18nService?: I18nService
|
||||
) {
|
||||
super(configService);
|
||||
// Assign to public properties for credit commands mixin
|
||||
this.sessionService = sessionService;
|
||||
this.creditService = creditService;
|
||||
this.i18nService = i18nService;
|
||||
if (i18nService) {
|
||||
this.i18nService = i18nService;
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue