[chore] fix some lint warnings

This commit is contained in:
MathieuG-P
2023-07-01 03:18:40 +02:00
parent d62727c3f9
commit 7b975a7ff0
12 changed files with 16 additions and 17 deletions
@@ -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 (
@@ -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();
}
@@ -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);