0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-02-04 01:09:14 -05:00

chore(web): Fixing up missing awaits (#3882)

* chore(web): Fixing up some missing awaits.

* chore(web/shared-viewer): Update import to shorted version.
This commit is contained in:
Skyler Mäntysaari 2023-08-27 07:31:52 +03:00 committed by GitHub
parent f1027d7807
commit 305889f32b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View file

@ -58,7 +58,7 @@
document.addEventListener('keydown', onKeyboardPress); document.addEventListener('keydown', onKeyboardPress);
if (!sharedLink) { if (!sharedLink) {
getAllAlbums(); await getAllAlbums();
} }
// Import hack :( see https://github.com/vadimkorr/svelte-carousel/issues/27#issuecomment-851022295 // Import hack :( see https://github.com/vadimkorr/svelte-carousel/issues/27#issuecomment-851022295
@ -136,7 +136,7 @@
if (hasNext) { if (hasNext) {
progressBar.restart(true); progressBar.restart(true);
} else { } else {
handleStopSlideshow(); await handleStopSlideshow();
} }
} }
@ -165,7 +165,7 @@
}, },
}); });
navigateAssetForward(); await navigateAssetForward();
for (const asset of deletedAssets) { for (const asset of deletedAssets) {
if (asset.status == 'SUCCESS') { if (asset.status == 'SUCCESS') {
@ -201,7 +201,7 @@
message: asset.isFavorite ? `Added to favorites` : `Removed from favorites`, message: asset.isFavorite ? `Added to favorites` : `Removed from favorites`,
}); });
} catch (error) { } catch (error) {
handleError(error, `Unable to ${asset.isFavorite ? `add asset to` : `remove asset from`} favorites`); await handleError(error, `Unable to ${asset.isFavorite ? `add asset to` : `remove asset from`} favorites`);
} }
}; };
@ -258,7 +258,7 @@
message: asset.isArchived ? `Added to archive` : `Removed from archive`, message: asset.isArchived ? `Added to archive` : `Removed from archive`,
}); });
} catch (error) { } catch (error) {
handleError(error, `Unable to ${asset.isArchived ? `add asset to` : `remove asset from`} archive`); await handleError(error, `Unable to ${asset.isArchived ? `add asset to` : `remove asset from`} archive`);
} }
}; };
@ -278,7 +278,7 @@
await api.assetApi.runAssetJobs({ assetJobsDto: { assetIds: [asset.id], name } }); await api.assetApi.runAssetJobs({ assetJobsDto: { assetIds: [asset.id], name } });
notificationController.show({ type: NotificationType.Info, message: api.getAssetJobMessage(name) }); notificationController.show({ type: NotificationType.Info, message: api.getAssetJobMessage(name) });
} catch (error) { } catch (error) {
handleError(error, `Unable to submit job`); await handleError(error, `Unable to submit job`);
} }
}; };

View file

@ -4,7 +4,7 @@
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import { videoViewerVolume } from '$lib/stores/preferences.store'; import { videoViewerVolume } from '$lib/stores/preferences.store';
import LoadingSpinner from '../shared-components/loading-spinner.svelte'; import LoadingSpinner from '../shared-components/loading-spinner.svelte';
import { handleError } from '../../utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
export let assetId: string; export let assetId: string;
@ -19,7 +19,7 @@
video.muted = false; video.muted = false;
dispatch('onVideoStarted'); dispatch('onVideoStarted');
} catch (error) { } catch (error) {
handleError(error, 'Unable to play video'); await handleError(error, 'Unable to play video');
} finally { } finally {
isVideoLoading = false; isVideoLoading = false;
} }

View file

@ -40,7 +40,7 @@
}); });
if (status === 201) { if (status === 201) {
goto(AppRoute.AUTH_LOGIN); await goto(AppRoute.AUTH_LOGIN);
return; return;
} else { } else {
error = 'Error create admin account'; error = 'Error create admin account';

View file

@ -45,7 +45,7 @@
} }
} catch (error) { } catch (error) {
authConfig.passwordLoginEnabled = true; authConfig.passwordLoginEnabled = true;
handleError(error, 'Unable to connect!'); await handleError(error, 'Unable to connect!');
} }
oauthLoading = false; oauthLoading = false;

View file

@ -16,7 +16,7 @@
import SelectAll from 'svelte-material-icons/SelectAll.svelte'; import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import ImmichLogo from '../shared-components/immich-logo.svelte'; import ImmichLogo from '../shared-components/immich-logo.svelte';
import { notificationController, NotificationType } from '../shared-components/notification/notification'; import { notificationController, NotificationType } from '../shared-components/notification/notification';
import { handleError } from '../../utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
export let sharedLink: SharedLinkResponseDto; export let sharedLink: SharedLinkResponseDto;
export let isOwned: boolean; export let isOwned: boolean;
@ -60,7 +60,7 @@
type: NotificationType.Info, type: NotificationType.Info,
}); });
} catch (e) { } catch (e) {
handleError(e, 'Unable to add assets to shared link'); await handleError(e, 'Unable to add assets to shared link');
} }
}; };

View file

@ -37,14 +37,14 @@
await api.sharedLinkApi.removeSharedLink({ id: deleteLinkId }); await api.sharedLinkApi.removeSharedLink({ id: deleteLinkId });
notificationController.show({ message: 'Deleted shared link', type: NotificationType.Info }); notificationController.show({ message: 'Deleted shared link', type: NotificationType.Info });
deleteLinkId = null; deleteLinkId = null;
refresh(); await refresh();
} catch (error) { } catch (error) {
handleError(error, 'Unable to delete shared link'); await handleError(error, 'Unable to delete shared link');
} }
}; };
const handleEditDone = async () => { const handleEditDone = async () => {
refresh(); await refresh();
editSharedLink = null; editSharedLink = null;
}; };