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:
Ben McCann 2024-02-27 08:37:37 -08:00 committed by GitHub
parent 57f25855d3
commit 907a95a746
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 312 additions and 282 deletions

View file

@ -2,7 +2,7 @@
import { goto } from '$app/navigation';
import { AppRoute } from '$lib/constants';
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
import { getKey } from '$lib/utils';
import { getKey, handlePromiseError } from '$lib/utils';
import { downloadArchive } from '$lib/utils/asset-utils';
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
import { handleError } from '$lib/utils/handle-error';
@ -29,7 +29,7 @@
dragAndDropFilesStore.subscribe((value) => {
if (value.isDragging && value.files.length > 0) {
handleUploadAssets(value.files);
handlePromiseError(handleUploadAssets(value.files));
dragAndDropFilesStore.set({ isDragging: false, files: [] });
}
});
@ -59,7 +59,7 @@
type: NotificationType.Info,
});
} catch (error) {
await handleError(error, 'Unable to add assets to shared link');
handleError(error, 'Unable to add assets to shared link');
}
};