mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2026-09-02 21:04:08 +03:00
refactor: fix misused promises (#2294)
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Vendored
+1
@@ -42,6 +42,7 @@
|
||||
"vue.format.style.initialIndent": true,
|
||||
"vue.inlayHints.inlineHandlerLeading": true,
|
||||
"vue.inlayHints.vBindShorthand": true,
|
||||
"vue.server.hybridMode": false,
|
||||
"sonarlint.output.showAnalyzerLogs": true,
|
||||
"sonarlint.output.showVerboseLogs": true,
|
||||
"sonarlint.connectedMode.project": {
|
||||
|
||||
@@ -4,8 +4,6 @@ const CI_environment = process.env.CI ? 0 : 1;
|
||||
const commonTSAndVueConfig = {
|
||||
extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
|
||||
rules: {
|
||||
// TODO: Investigate why this rule reports false positives
|
||||
'@typescript-eslint/no-misused-promises': 'off',
|
||||
'no-secrets/no-secrets': 'error',
|
||||
'@typescript-eslint/consistent-type-exports': 'error',
|
||||
'@typescript-eslint/no-redundant-type-constituents': 'off'
|
||||
|
||||
@@ -22,8 +22,8 @@ const searchQuery = computed({
|
||||
get(): string {
|
||||
return route.query.q?.toString() ?? '';
|
||||
},
|
||||
async set(value) {
|
||||
await router.replace({
|
||||
set(value) {
|
||||
void router.replace({
|
||||
...router.currentRoute,
|
||||
query: {
|
||||
q: value.trim() || undefined
|
||||
|
||||
@@ -303,9 +303,7 @@ function _sharedInternalLogic<T extends Record<K, (...args: any[]) => any>, K ex
|
||||
* mounted. setTimeout executes it when the event loop is clear, avoiding overwhelming the engine.
|
||||
*/
|
||||
if (isCached.value) {
|
||||
window.setTimeout(async () => {
|
||||
await run({ isRefresh: true });
|
||||
});
|
||||
void run({ isRefresh: true });
|
||||
}
|
||||
|
||||
if (!isCached.value && isFuncDefined()) {
|
||||
|
||||
@@ -309,7 +309,7 @@ class RemotePluginAuth {
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
window.setTimeout(async () => await this.refreshCurrentUserInfo());
|
||||
void this.refreshCurrentUserInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,14 +61,9 @@ router.back = (): ReturnType<typeof router.back> => {
|
||||
route.value.meta.transition.leave = leaveTransition;
|
||||
}
|
||||
|
||||
window.setTimeout(
|
||||
async () =>
|
||||
await router.replace(
|
||||
isStr(router.options.history.state.back)
|
||||
? router.options.history.state.back
|
||||
: '/'
|
||||
)
|
||||
);
|
||||
void router.replace(isStr(router.options.history.state.back)
|
||||
? router.options.history.state.back
|
||||
: '/');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -694,13 +694,7 @@ class PlaybackManagerStore extends CommonStore<PlaybackManagerState> {
|
||||
this._reset();
|
||||
this.currentVolume = volume;
|
||||
|
||||
window.setTimeout(async () => {
|
||||
try {
|
||||
if (sessionId && itemId && time && remote.auth.currentUser) {
|
||||
await this._reportPlaybackStopped(itemId, sessionId, time);
|
||||
}
|
||||
} catch {}
|
||||
});
|
||||
void this._reportPlaybackStopped(itemId, sessionId, time);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user