chore(web): cleanup promise handling (#7382)
* no-misused-promises * no-floating-promises * format * revert for now * remove load function * require-await * revert a few no-floating-promises changes that would cause no-misused-promises failures * format * fix a few more * fix most remaining errors * executor-queue * executor-queue.spec * remove duplicate comments by grouping rules * upgrade sveltekit and enforce rules * oops. move await * try this * just ignore for now since it's only a test * run in parallel * Update web/src/routes/admin/jobs-status/+page.svelte Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> * remove Promise.resolve call * rename function * remove unnecessary warning silencing * make handleError sync * fix new errors from recently merged PR to main * extract method * use handlePromiseError --------- Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -185,7 +185,7 @@
|
||||
}
|
||||
};
|
||||
|
||||
const handleEscape = () => {
|
||||
const handleEscape = async () => {
|
||||
if ($showAssetViewer || viewMode === ViewMode.SUGGEST_MERGE) {
|
||||
return;
|
||||
}
|
||||
@@ -193,7 +193,7 @@
|
||||
assetInteractionStore.clearMultiselect();
|
||||
return;
|
||||
} else {
|
||||
goto(previousRoute);
|
||||
await goto(previousRoute);
|
||||
return;
|
||||
}
|
||||
};
|
||||
@@ -235,7 +235,7 @@
|
||||
type: NotificationType.Info,
|
||||
});
|
||||
|
||||
goto(previousRoute, { replaceState: true });
|
||||
await goto(previousRoute, { replaceState: true });
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to hide person');
|
||||
}
|
||||
@@ -244,7 +244,7 @@
|
||||
const handleMerge = async (person: PersonResponseDto) => {
|
||||
const { assets } = await getPersonStatistics({ id: person.id });
|
||||
numberOfAssets = assets;
|
||||
handleGoBack();
|
||||
await handleGoBack();
|
||||
|
||||
data.person = person;
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
refreshAssetGrid = !refreshAssetGrid;
|
||||
return;
|
||||
}
|
||||
goto(`${AppRoute.PEOPLE}/${personToBeMergedIn.id}`, { replaceState: true });
|
||||
await goto(`${AppRoute.PEOPLE}/${personToBeMergedIn.id}`, { replaceState: true });
|
||||
} catch (error) {
|
||||
handleError(error, 'Unable to save name');
|
||||
}
|
||||
@@ -341,7 +341,7 @@
|
||||
return;
|
||||
}
|
||||
if (name === '') {
|
||||
changeName();
|
||||
await changeName();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
viewMode = ViewMode.SUGGEST_MERGE;
|
||||
return;
|
||||
}
|
||||
changeName();
|
||||
await changeName();
|
||||
};
|
||||
|
||||
const handleSetBirthDate = async (birthDate: string) => {
|
||||
@@ -392,11 +392,11 @@
|
||||
}
|
||||
};
|
||||
|
||||
const handleGoBack = () => {
|
||||
const handleGoBack = async () => {
|
||||
viewMode = ViewMode.VIEW_ASSETS;
|
||||
if ($page.url.searchParams.has(QueryParameter.ACTION)) {
|
||||
$page.url.searchParams.delete(QueryParameter.ACTION);
|
||||
goto($page.url);
|
||||
await goto($page.url);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user