From 10f773c9b609726a4fd69bc636f4583a7ad97597 Mon Sep 17 00:00:00 2001 From: lovegaoshi <106490582+lovegaoshi@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:15:39 -0800 Subject: [PATCH] fix: lint --- src/hooks/useSetupPlayer.ts | 3 ++- src/utils/Utils.ts | 7 ++----- src/utils/sync/Dropbox.ts | 6 +++--- src/utils/sync/Github.ts | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/hooks/useSetupPlayer.ts b/src/hooks/useSetupPlayer.ts index 3b0945dcb..ddace194d 100644 --- a/src/hooks/useSetupPlayer.ts +++ b/src/hooks/useSetupPlayer.ts @@ -56,7 +56,8 @@ export default ({ intentData, vip }: NoxComponent.SetupPlayerProps) => { const { updateVersion, checkVersion } = useVersionCheck(); const setIntentData = useNoxSetting(state => state.setIntentData); const { checkPlayStoreUpdates } = usePlayStore(); - const {} = useActiveTrack(); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _activeTrack = useActiveTrack(); useEffect(() => { if (!vip) { diff --git a/src/utils/Utils.ts b/src/utils/Utils.ts index 1d923997a..80b286482 100644 --- a/src/utils/Utils.ts +++ b/src/utils/Utils.ts @@ -207,11 +207,8 @@ export const execWhenTrue = async ({ executeFn, wait = 50, }: ExecWhenTrue) => { - while (true) { - if (await loopCheck()) { - executeFn(); - return; - } + while (!(await loopCheck())) { await timeout(wait); } + executeFn(); }; diff --git a/src/utils/sync/Dropbox.ts b/src/utils/sync/Dropbox.ts index 9a52ae23c..f46a1305a 100644 --- a/src/utils/sync/Dropbox.ts +++ b/src/utils/sync/Dropbox.ts @@ -35,7 +35,7 @@ export const noxBackup = ( const download = async ( dbx: _Dropbox, - contentParse: (v: Blob) => Promise, + contentParse: (v: Blob) => Promise, fpath = DEFAULT_FILE_PATH, ) => { if (fpath === null) { @@ -43,7 +43,7 @@ const download = async ( } const downloadedFile = await dbx.filesDownload({ path: fpath }); // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore: dropbox didnt have fileBlob in their sdk anywhere but UPGRADING.md + // @ts-expect-error: dropbox didnt have fileBlob in their sdk anywhere but UPGRADING.md const blob = await contentParse(downloadedFile.result.fileBlob); return new Uint8Array(blob); }; @@ -55,7 +55,7 @@ const download = async ( */ export const noxRestore = async ( dbx: _Dropbox, - contentParse: (v: Blob) => Promise, + contentParse: (v: Blob) => Promise, ) => { const noxFile = await find(dbx); if (!noxFile) { diff --git a/src/utils/sync/Github.ts b/src/utils/sync/Github.ts index 41488aa61..3fe2ea819 100644 --- a/src/utils/sync/Github.ts +++ b/src/utils/sync/Github.ts @@ -80,7 +80,7 @@ export const checkAuthentication = async (token = '') => { export const noxRestore = async ( token: string, - contentParse: (v: Blob) => Promise, + contentParse: (v: Blob) => Promise, ) => { const res = await bfetch( `https://api.github.com/repos/${await getUserName(token)}/${APM_REPO_NAME}/contents/${APM_FILE_NAME}`,