diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 18aa1122..e570de0c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -48,17 +48,14 @@ function isTauri() { /** * Conditionally imports the necessary service based on the current environment */ -export function DataFactory( - ngxIndexedDBService: NgxIndexedDBService, - http: HttpClient -) { +export function DataFactory() { if (isElectron()) { return new ElectronService(); } if (isTauri()) { return new TauriService(); } - return new PwaService(http); + return new PwaService(); } @NgModule({ diff --git a/src/app/services/pwa.service.ts b/src/app/services/pwa.service.ts index 7e5f6a1b..a9aa4dd6 100644 --- a/src/app/services/pwa.service.ts +++ b/src/app/services/pwa.service.ts @@ -1,5 +1,5 @@ import { HttpClient } from '@angular/common/http'; -import { ApplicationRef, inject, Injectable } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; import { SwUpdate } from '@angular/service-worker'; import { Store } from '@ngrx/store'; @@ -19,23 +19,21 @@ import { Playlist } from '../../../shared/playlist.interface'; import { AppConfig } from '../../environments/environment'; import * as PlaylistActions from '../state/actions'; import { DataService } from './data.service'; -import { PlaylistsService } from './playlists.service'; @Injectable({ providedIn: 'root', }) export class PwaService extends DataService { - appRef = inject(ApplicationRef); - playlistService = inject(PlaylistsService); - snackBar = inject(MatSnackBar); - store = inject(Store); - swUpdate = inject(SwUpdate); - translateService = inject(TranslateService); + private readonly http = inject(HttpClient); + private readonly snackBar = inject(MatSnackBar); + private readonly store = inject(Store); + private readonly swUpdate = inject(SwUpdate); + private readonly translateService = inject(TranslateService); /** Proxy URL to avoid CORS issues */ corsProxyUrl = AppConfig.BACKEND_URL; - constructor(private http: HttpClient) { + constructor() { super(); console.log('PWA service initialized...'); }