fix: apply fix from eslint

This commit is contained in:
JellyBrick
2024-10-13 22:45:11 +09:00
parent f42f20f770
commit cb1381bbb3
85 changed files with 1858 additions and 1042 deletions

View File

@ -6,7 +6,9 @@ import getSongControls from './song-controls';
export const APP_PROTOCOL = 'youtubemusic';
let protocolHandler: ((cmd: string, args: string[] | undefined) => void) | undefined;
let protocolHandler:
| ((cmd: string, args: string[] | undefined) => void)
| undefined;
export function setupProtocolHandler(win: BrowserWindow) {
if (process.defaultApp && process.argv.length >= 2) {
@ -19,7 +21,10 @@ export function setupProtocolHandler(win: BrowserWindow) {
const songControls = getSongControls(win);
protocolHandler = ((cmd: keyof typeof songControls, args: string[] | undefined = undefined) => {
protocolHandler = ((
cmd: keyof typeof songControls,
args: string[] | undefined = undefined,
) => {
if (Object.keys(songControls).includes(cmd)) {
songControls[cmd](args as never);
}
@ -30,7 +35,9 @@ export function handleProtocol(cmd: string, args: string[] | undefined) {
protocolHandler?.(cmd, args);
}
export function changeProtocolHandler(f: (cmd: string, args: string[] | undefined) => void) {
export function changeProtocolHandler(
f: (cmd: string, args: string[] | undefined) => void,
) {
protocolHandler = f;
}