diff --git a/src/renderer/components/modal/modal-types/login-modal.component.tsx b/src/renderer/components/modal/modal-types/login-modal.component.tsx index b3f1aa09..4365e0d3 100644 --- a/src/renderer/components/modal/modal-types/login-modal.component.tsx +++ b/src/renderer/components/modal/modal-types/login-modal.component.tsx @@ -5,9 +5,11 @@ import { useTranslation } from "renderer/hooks/use-translation.hook"; import { ModalComponent, ModalExitCode, ModalService } from "renderer/services/modale.service"; import BeatImpatient from "../../../../../assets/images/apngs/beat-impatient.png"; import { WhyCredentialsModal } from "./why-credentials-modal.component"; +import { useService } from "renderer/hooks/use-service.hook"; export const LoginModal: ModalComponent<{ username: string; password: string; stay: boolean }> = ({ resolver }) => { - const modal = ModalService.getInsance(); + + const modal = useService(ModalService); const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); diff --git a/src/renderer/components/modal/modal.component.tsx b/src/renderer/components/modal/modal.component.tsx index 265311ea..17aeb47e 100644 --- a/src/renderer/components/modal/modal.component.tsx +++ b/src/renderer/components/modal/modal.component.tsx @@ -6,7 +6,7 @@ import { useEffect } from "react"; import { BsmIcon } from "../svgs/bsm-icon.component"; export function Modal() { - const modalSevice = ModalService.getInsance(); + const modalSevice = ModalService.getInstance(); const ModalComponent = useObservable(modalSevice.getModalToShow()); diff --git a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx index 4f3e5d36..40d57163 100644 --- a/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx +++ b/src/renderer/components/version-viewer/slides/mods/mods-slide.component.tsx @@ -26,7 +26,7 @@ export function ModsSlide({ version, onDisclamerDecline }: { version: BSVersion; const modsManager = useService(BsModsManagerService); const configService = useService(ConfigurationService); const linkOpener = useService(LinkOpenerService); - const modals = ModalService.getInsance(); + const modals = useService(ModalService); const os = useService(OsDiagnosticService); const ref = useRef(null); diff --git a/src/renderer/pages/available-versions-list.components.tsx b/src/renderer/pages/available-versions-list.components.tsx index 40515778..91ebcd4e 100644 --- a/src/renderer/pages/available-versions-list.components.tsx +++ b/src/renderer/pages/available-versions-list.components.tsx @@ -1,8 +1,7 @@ import { AvailableVersionsSlider } from "../components/available-versions/available-versions-slider.component"; import { BsDownloaderService } from "../services/bs-downloader.service"; import { Slideshow } from "renderer/components/slideshow/slideshow.component"; -import { useEffect, useState } from "react"; -import { BSVersion } from "shared/bs-version.interface"; +import { useState } from "react"; import { BsmButton } from "renderer/components/shared/bsm-button.component"; import { AnimatePresence, motion } from "framer-motion"; import { useTranslation } from "renderer/hooks/use-translation.hook"; @@ -21,7 +20,7 @@ export function AvailableVersionsList() { const bsDownloaderService = useService(BsDownloaderService); const versionManagerService = useService(BSVersionManagerService); const progressBar = useService(ProgressBarService); - const modal = ModalService.getInsance(); + const modal = useService(ModalService); const ipc = useService(IpcService); const installer = useService(BsDownloaderService); const notification = useService(NotificationService); diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index d3302b58..63092e57 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -37,15 +37,15 @@ import { BsmException } from "shared/models/bsm-exception.model"; export function SettingsPage() { - const configService: ConfigurationService = useService(ConfigurationService); - const themeService: ThemeService = useService(ThemeService); - const ipcService: IpcService = useService(IpcService); - const modalService: ModalService = ModalService.getInsance(); - const downloaderService: BsDownloaderService = useService(BsDownloaderService); - const progressBarService: ProgressBarService = useService(ProgressBarService); - const notificationService: NotificationService = useService(NotificationService); - const i18nService: I18nService = useService(I18nService); - const linkOpener: LinkOpenerService = useService(LinkOpenerService); + const configService = useService(ConfigurationService); + const themeService = useService(ThemeService); + const ipcService = useService(IpcService); + const modalService = useService(ModalService); + const downloaderService = useService(BsDownloaderService); + const progressBarService = useService(ProgressBarService); + const notificationService = useService(NotificationService); + const i18nService = useService(I18nService); + const linkOpener = useService(LinkOpenerService); const mapsManager = useService(MapsManagerService); const playlistsManager = useService(PlaylistsManagerService); const modelsManager = useService(ModelsManagerService); diff --git a/src/renderer/pages/version-viewer.component.tsx b/src/renderer/pages/version-viewer.component.tsx index c7166ec8..1a46c903 100644 --- a/src/renderer/pages/version-viewer.component.tsx +++ b/src/renderer/pages/version-viewer.component.tsx @@ -26,7 +26,7 @@ export function VersionViewer() { const bsUninstallerService = useService(BSUninstallerService); const bsVersionManagerService = useService(BSVersionManagerService); - const modalService = ModalService.getInsance(); + const modalService = useService(ModalService); const bsDownloaderService = useService(BsDownloaderService); const ipcService = useService(IpcService); const bsLauncher = useService(BSLauncherService); diff --git a/src/renderer/services/bs-downloader.service.ts b/src/renderer/services/bs-downloader.service.ts index 10d2b730..ab1d0b46 100644 --- a/src/renderer/services/bs-downloader.service.ts +++ b/src/renderer/services/bs-downloader.service.ts @@ -39,7 +39,7 @@ export class BsDownloaderService { private constructor() { this.ipcService = IpcService.getInstance(); - this.modalService = ModalService.getInsance(); + this.modalService = ModalService.getInstance(); this.bsVersionManager = BSVersionManagerService.getInstance(); this.authService = AuthUserService.getInstance(); this.progressBarService = ProgressBarService.getInstance(); diff --git a/src/renderer/services/bs-mods-manager.service.ts b/src/renderer/services/bs-mods-manager.service.ts index 0af4e89c..2aa9819a 100644 --- a/src/renderer/services/bs-mods-manager.service.ts +++ b/src/renderer/services/bs-mods-manager.service.ts @@ -36,7 +36,7 @@ export class BsModsManagerService { private constructor() { this.ipcService = IpcService.getInstance(); this.progressBar = ProgressBarService.getInstance(); - this.modals = ModalService.getInsance(); + this.modals = ModalService.getInstance(); this.notifications = NotificationService.getInstance(); this.os = OsDiagnosticService.getInstance(); } diff --git a/src/renderer/services/bs-version-manager.service.ts b/src/renderer/services/bs-version-manager.service.ts index bf5ae632..5da004da 100644 --- a/src/renderer/services/bs-version-manager.service.ts +++ b/src/renderer/services/bs-version-manager.service.ts @@ -19,7 +19,7 @@ export class BSVersionManagerService { private constructor() { this.ipcService = IpcService.getInstance(); - this.modalService = ModalService.getInsance(); + this.modalService = ModalService.getInstance(); this.notificationService = NotificationService.getInstance(); this.progressBarService = ProgressBarService.getInstance(); this.askAvailableVersions().then(() => this.askInstalledVersions()); diff --git a/src/renderer/services/maps-downloader.service.ts b/src/renderer/services/maps-downloader.service.ts index 76b979b0..7f321ecd 100644 --- a/src/renderer/services/maps-downloader.service.ts +++ b/src/renderer/services/maps-downloader.service.ts @@ -34,7 +34,7 @@ export class MapsDownloaderService { public readonly progressBarStyle: CSSProperties = { zIndex: 100000, position: "fixed", bottom: "10px", right: 0 }; private constructor() { - this.modals = ModalService.getInsance(); + this.modals = ModalService.getInstance(); this.progressBar = ProgressBarService.getInstance(); this.ipc = IpcService.getInstance(); this.os = OsDiagnosticService.getInstance(); diff --git a/src/renderer/services/maps-manager.service.ts b/src/renderer/services/maps-manager.service.ts index 0104dd05..aacf9cb6 100644 --- a/src/renderer/services/maps-manager.service.ts +++ b/src/renderer/services/maps-manager.service.ts @@ -40,7 +40,7 @@ export class MapsManagerService { private constructor() { this.ipcService = IpcService.getInstance(); - this.modal = ModalService.getInsance(); + this.modal = ModalService.getInstance(); this.progressBar = ProgressBarService.getInstance(); this.notifications = NotificationService.getInstance(); this.config = ConfigurationService.getInstance(); diff --git a/src/renderer/services/modale.service.ts b/src/renderer/services/modale.service.ts index 35aa6610..650c89aa 100644 --- a/src/renderer/services/modale.service.ts +++ b/src/renderer/services/modale.service.ts @@ -10,7 +10,7 @@ export class ModalService { private constructor() {} - public static getInsance() { + public static getInstance() { if (!this.instance) { this.instance = new ModalService(); } diff --git a/src/renderer/services/models-management/models-downloader.service.ts b/src/renderer/services/models-management/models-downloader.service.ts index b50558ec..a1b395a2 100644 --- a/src/renderer/services/models-management/models-downloader.service.ts +++ b/src/renderer/services/models-management/models-downloader.service.ts @@ -34,7 +34,7 @@ export class ModelsDownloaderService { private constructor() { this.ipc = IpcService.getInstance(); - this.modal = ModalService.getInsance(); + this.modal = ModalService.getInstance(); this.progress = ProgressBarService.getInstance(); this._currentDownload$.pipe(filter(v => !!v)).subscribe(model => this.downloadModel(model)); diff --git a/src/renderer/services/models-management/models-manager.service.ts b/src/renderer/services/models-management/models-manager.service.ts index 23341c82..3dd5f111 100644 --- a/src/renderer/services/models-management/models-manager.service.ts +++ b/src/renderer/services/models-management/models-manager.service.ts @@ -38,7 +38,7 @@ export class ModelsManagerService { private constructor() { this.ipc = IpcService.getInstance(); this.versionFolderLinked = VersionFolderLinkerService.getInstance(); - this.modalService = ModalService.getInsance(); + this.modalService = ModalService.getInstance(); this.progressBar = ProgressBarService.getInstance(); this.notifications = NotificationService.getInstance(); this.config = ConfigurationService.getInstance();