Hata düzeltildi. ApiGenerateBackgroundWorkers
This commit is contained in:
parent
63e3e5a1db
commit
6e90ddc37d
1 changed files with 18 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Notification, toast } from '@/components/ui'
|
||||
import { generateBackgroundWorkers } from '@/services/background-worker.service'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import { getLocalization } from '@/services/localization.service'
|
||||
import { store } from '@/store'
|
||||
|
||||
export abstract class UiEvalService {
|
||||
static Init = () => {
|
||||
|
|
@ -8,7 +9,22 @@ export abstract class UiEvalService {
|
|||
}
|
||||
|
||||
static ApiGenerateBackgroundWorkers = () => {
|
||||
const { translate } = useLocalization()
|
||||
// Get store state directly instead of using hook
|
||||
const state = store.getState()
|
||||
const { texts, config } = state.abpConfig
|
||||
|
||||
// Create translate function similar to useLocalization hook
|
||||
const translate = (localizationKey: string, params?: Record<string, string | number>, defaultResourceName?: string): string => {
|
||||
if (!texts) {
|
||||
return localizationKey
|
||||
}
|
||||
return getLocalization(
|
||||
texts,
|
||||
defaultResourceName ?? config?.localization?.defaultResourceName,
|
||||
localizationKey,
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
const asyncCall = async () => {
|
||||
await generateBackgroundWorkers()
|
||||
|
|
|
|||
Loading…
Reference in a new issue