mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] fix some lint warnings
This commit is contained in:
@@ -111,7 +111,7 @@ export class BeatSaverApiService {
|
||||
return {status: res.status, data: null};
|
||||
}
|
||||
|
||||
const data: any = await res.json();
|
||||
const data = await res.json();
|
||||
|
||||
return {status: res.status, data};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ export class BeatSaverService {
|
||||
|
||||
return this.bsaverApi.searchMaps(search).then(res => {
|
||||
return res.status === 200 ? res.data.docs : [];
|
||||
}).catch(err => {
|
||||
}).catch(() => {
|
||||
return [];
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { spawnSync } from "child_process";
|
||||
import path from "path";
|
||||
import { app, BrowserWindow } from "electron";
|
||||
import { IpcResponse } from "shared/models/ipc";
|
||||
@@ -45,7 +44,7 @@ export class UtilsService{
|
||||
}
|
||||
}
|
||||
|
||||
public ipcSend<T = any>(channel: string, response: IpcResponse<T>): void{
|
||||
public ipcSend<T = unknown>(channel: string, response: IpcResponse<T>): void{
|
||||
try {
|
||||
Array.from(this.windows.values()).forEach(window => window?.webContents?.send(channel, response));
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
|
||||
import { getFoldersInFolder } from "../helpers/fs.helpers";
|
||||
import path from "path";
|
||||
import { VersionLinkerAction, VersionLinkFolderAction, VersionUnlinkFolderAction } from "renderer/services/version-folder-linker.service";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
|
||||
@@ -80,7 +80,7 @@ export class WindowManagerService{
|
||||
}
|
||||
|
||||
public getAppWindowFromWebContents(sender: Electron.WebContents): AppWindow{
|
||||
return Array.from(this.windows.entries()).find(([key, value]) => value.webContents.id === sender.id)[0];
|
||||
return Array.from(this.windows.entries()).find(([, value]) => value.webContents.id === sender.id)[0];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import { useDelayedState } from "renderer/hooks/use-delayed-state.hook";
|
||||
|
||||
export type ParsedMapDiff = {type: BsvMapDifficultyType, name: string, stars: number}
|
||||
|
||||
export type MapItemProps<T = any> = {
|
||||
export type MapItemProps<T = unknown> = {
|
||||
hash: string,
|
||||
title: string,
|
||||
autor: string,
|
||||
@@ -66,8 +66,8 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
useDoubleClick({
|
||||
ref,
|
||||
latency: onDoubleClick ? 200 : 0,
|
||||
onSingleClick: e => onSelected?.(callBackParam),
|
||||
onDoubleClick: e => onDoubleClick?.(callBackParam)
|
||||
onSingleClick: () => onSelected?.(callBackParam),
|
||||
onDoubleClick: () => onDoubleClick?.(callBackParam)
|
||||
})
|
||||
|
||||
const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
|
||||
@@ -129,7 +129,7 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
const diffSets = Array.from(diffs.entries());
|
||||
|
||||
if(diffSets.length === 1){
|
||||
const [diffType, diffSet] = diffSets[0];
|
||||
const [, diffSet] = diffSets[0];
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -150,6 +150,8 @@ export const MapItem = memo(({hash, title, autor, songAutor, coverUrl, songUrl,
|
||||
</Fragment>
|
||||
));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ export function MapsPlaylistsPanel({version, isActive}: Props) {
|
||||
|
||||
const sub = mapsService.$mapsLinkingPending(version).pipe(debounceTime(50)).subscribe(setLinkingPending);
|
||||
|
||||
const onMapsLinked: VersionLinkerActionListener = (action, linked) => {
|
||||
const onMapsLinked: VersionLinkerActionListener = (action) => {
|
||||
if(!action.relativeFolder.includes(MapsManagerService.RELATIVE_MAPS_FOLDER)){ return; }
|
||||
loadMapIsLinked();
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import { catchError, of } from "rxjs";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { BsmLocalModel } from "shared/models/models/bsm-local-model.interface";
|
||||
|
||||
export const DownloadModelsModal: ModalComponent<void, {version: BSVersion, type: MSModelType, owned: BsmLocalModel[]}> = ({resolver, data: { version, type, owned }}) => {
|
||||
export const DownloadModelsModal: ModalComponent<void, {version: BSVersion, type: MSModelType, owned: BsmLocalModel[]}> = ({data: { version, type, owned }}) => {
|
||||
|
||||
const modelsDownloader = useService(ModelsDownloaderService);
|
||||
const modelSaber = useService(ModelSaberService);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useInView } from "framer-motion";
|
||||
import { BSVersion } from "shared/bs-version.interface";
|
||||
import { useRef, forwardRef, useImperativeHandle, useState } from "react";
|
||||
import { useRef, forwardRef, useImperativeHandle } from "react";
|
||||
import { MSModelType } from "shared/models/models/model-saber.model";
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
|
||||
import { useConstant } from "renderer/hooks/use-constant.hook";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BSVersion } from "shared/bs-version.interface"
|
||||
import { MSModelType } from "../../../shared/models/models/model-saber.model"
|
||||
import { LinkButton } from "../maps-mangement-components/link-button.component"
|
||||
import { DetailedHTMLProps, useState } from "react"
|
||||
import { useState } from "react"
|
||||
import { useOnUpdate } from "renderer/hooks/use-on-update.hook"
|
||||
import { ModelsManagerService } from "renderer/services/models-management/models-manager.service"
|
||||
import { BsContentNavBar, BsContentNavBarTab } from "../shared/bs-content-nav-bar.component"
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function SettingColorChooser({color, onChange, pickerClassName}:
|
||||
|
||||
const [colorVisible, setColorVisible] = useState(false);
|
||||
const ref = useRef(null);
|
||||
useClickOutside(ref, (e) => setColorVisible(() => false));
|
||||
useClickOutside(ref, () => setColorVisible(() => false));
|
||||
|
||||
return (
|
||||
<div ref={ref} className="relative cursor-pointer mx-3 h-full aspect-square flex flex-col items-center z-[1]">
|
||||
|
||||
@@ -37,7 +37,6 @@ export function ModsSlide({version, onDisclamerDecline}: {version: BSVersion, on
|
||||
const [moreInfoMod, setMoreInfoMod] = useState(null as Mod);
|
||||
const isOnline = useObservable(os.isOnline$);
|
||||
const installing = useObservable(modsManager.isInstalling$);
|
||||
const t = useTranslation();
|
||||
|
||||
const downloadRef = useRef(null);
|
||||
const [downloadWith, setDownloadWidth] = useState(0);
|
||||
|
||||
Reference in New Issue
Block a user