1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-26 05:01:05 +02:00

chore: update deps (#14755)

This commit is contained in:
Daniel Dietzler
2024-12-18 15:19:48 +01:00
committed by GitHub
parent a03f4f5610
commit 6a855f6331
38 changed files with 4610 additions and 14215 deletions

View File

@ -29,7 +29,7 @@
// click runs before bind
const previouslyEnabled = config.oauth.mobileOverrideEnabled;
if (!previouslyEnabled && !config.oauth.mobileRedirectUri) {
config.oauth.mobileRedirectUri = window.location.origin + '/api/oauth/mobile-redirect';
config.oauth.mobileRedirectUri = globalThis.location.origin + '/api/oauth/mobile-redirect';
}
};

View File

@ -57,11 +57,11 @@
handleError(error, $t('error_loading_image'));
});
window.addEventListener('mousemove', handleMouseMove);
globalThis.addEventListener('mousemove', handleMouseMove);
});
onDestroy(() => {
window.removeEventListener('mousemove', handleMouseMove);
globalThis.removeEventListener('mousemove', handleMouseMove);
resetCropStore();
resetGlobalCropStore();
});

View File

@ -58,7 +58,7 @@ export function handleMouseDown(e: MouseEvent) {
}
document.body.style.userSelect = 'none';
window.addEventListener('mouseup', handleMouseUp);
globalThis.addEventListener('mouseup', handleMouseUp);
}
export function handleMouseMove(e: MouseEvent) {
@ -80,7 +80,7 @@ export function handleMouseMove(e: MouseEvent) {
}
export function handleMouseUp() {
window.removeEventListener('mouseup', handleMouseUp);
globalThis.removeEventListener('mouseup', handleMouseUp);
document.body.style.userSelect = '';
stopInteraction();
}

View File

@ -107,7 +107,7 @@
};
const onCopyShortcut = (event: KeyboardEvent) => {
if (window.getSelection()?.type === 'Range') {
if (globalThis.getSelection()?.type === 'Range') {
return;
}
event.preventDefault();

View File

@ -11,7 +11,6 @@
let { onSuccess }: Props = $props();
let errorMessage: string = $state('');
let success: string;
let password = $state('');
let passwordConfirm = $state('');
@ -59,9 +58,6 @@
<p class="text-sm text-red-400">{errorMessage}</p>
{/if}
{#if success}
<p class="text-sm text-immich-primary">{success}</p>
{/if}
<div class="my-5 flex w-full">
<Button type="submit" size="lg" fullwidth>{$t('to_change_password')}</Button>
</div>

View File

@ -28,8 +28,6 @@
onEditSuccess,
}: Props = $props();
let error: string;
let success: string;
let quotaSize = $state(user.quotaSizeInBytes ? convertFromBytes(user.quotaSizeInBytes, ByteUnit.GiB) : null);
const previousQutoa = user.quotaSizeInBytes;
@ -149,14 +147,6 @@
</a>
</p>
</div>
{#if error}
<p class="ml-4 text-sm text-red-400">{error}</p>
{/if}
{#if success}
<p class="ml-4 text-sm text-immich-primary">{success}</p>
{/if}
</form>
{#snippet stickyBottom()}

View File

@ -33,9 +33,9 @@
return;
}
if (oauth.isCallback(window.location)) {
if (oauth.isCallback(globalThis.location)) {
try {
await oauth.login(window.location);
await oauth.login(globalThis.location);
await onSuccess();
return;
} catch (error) {
@ -46,9 +46,9 @@
}
try {
if ($featureFlags.oauthAutoLaunch && !oauth.isAutoLaunchDisabled(window.location)) {
if ($featureFlags.oauthAutoLaunch && !oauth.isAutoLaunchDisabled(globalThis.location)) {
await goto(`${AppRoute.AUTH_LOGIN}?autoLaunch=0`, { replaceState: true });
await oauth.authorize(window.location);
await oauth.authorize(globalThis.location);
return;
}
} catch (error) {
@ -85,7 +85,7 @@
const handleOAuthLogin = async () => {
oauthLoading = true;
oauthError = '';
const success = await oauth.authorize(window.location);
const success = await oauth.authorize(globalThis.location);
if (!success) {
oauthLoading = false;
oauthError = $t('errors.unable_to_login_with_oauth');

View File

@ -1,6 +1,6 @@
<script lang="ts">
import type { InterpolationValues } from '$lib/components/i18n/format-message';
import FormatMessage from '$lib/components/i18n/format-message.svelte';
import type { InterpolationValues } from '$lib/components/i18n/format-message.svelte';
import type { Translations } from 'svelte-i18n';
interface Props {

View File

@ -1,10 +1,5 @@
<script lang="ts" module>
import type { FormatXMLElementFn, PrimitiveType } from 'intl-messageformat';
export type InterpolationValues = Record<string, PrimitiveType | FormatXMLElementFn<unknown>>;
</script>
<script lang="ts">
import { IntlMessageFormat } from 'intl-messageformat';
import { IntlMessageFormat, type FormatXMLElementFn } from 'intl-messageformat';
import {
TYPE,
type MessageFormatElement,
@ -12,6 +7,7 @@
type SelectElement,
} from '@formatjs/icu-messageformat-parser';
import { locale as i18nLocale, json, type Translations } from 'svelte-i18n';
import type { InterpolationValues } from '$lib/components/i18n/format-message';
type MessagePart = {
message: string;

View File

@ -0,0 +1,2 @@
import type { FormatXMLElementFn, PrimitiveType } from 'intl-messageformat';
export type InterpolationValues = Record<string, PrimitiveType | FormatXMLElementFn<unknown>>;

View File

@ -69,6 +69,7 @@
}
showLoadingSpinner = true;
// eslint-disable-next-line unicorn/prefer-global-this
const searchTimeout = window.setTimeout(() => {
if (searchWord === '') {
places = [];

View File

@ -29,6 +29,7 @@
const contextMenuEvent = new MouseEvent('contextmenu', {
bubbles: true,
cancelable: true,
// eslint-disable-next-line unicorn/prefer-global-this
view: window,
clientX: event.x,
clientY: event.y,

View File

@ -5,10 +5,10 @@ import { NotificationType } from '../notification';
import NotificationCard from '../notification-card.svelte';
describe('NotificationCard component', () => {
let sut: RenderResult<NotificationCard>;
let sut: RenderResult<typeof NotificationCard>;
it('disposes timeout if already removed from the DOM', () => {
vi.spyOn(window, 'clearTimeout');
vi.spyOn(globalThis, 'clearTimeout');
sut = render(NotificationCard, {
notification: {
@ -21,7 +21,7 @@ describe('NotificationCard component', () => {
});
cleanup();
expect(window.clearTimeout).toHaveBeenCalledTimes(1);
expect(globalThis.clearTimeout).toHaveBeenCalledTimes(1);
});
it('shows message and title', () => {

View File

@ -20,11 +20,11 @@
let loading = $state(true);
onMount(async () => {
if (oauth.isCallback(window.location)) {
if (oauth.isCallback(globalThis.location)) {
try {
loading = true;
user = await oauth.link(window.location);
user = await oauth.link(globalThis.location);
notificationController.show({
message: $t('linked_oauth_account'),
@ -64,7 +64,7 @@
{#if user.oauthId}
<Button size="sm" onclick={() => handleUnlink()}>{$t('unlink_oauth')}</Button>
{:else}
<Button size="sm" onclick={() => oauth.authorize(window.location)}>{$t('link_to_oauth')}</Button>
<Button size="sm" onclick={() => oauth.authorize(globalThis.location)}>{$t('link_to_oauth')}</Button>
{/if}
{/if}
</div>

View File

@ -64,10 +64,7 @@
for (const candidate of sharedWith) {
const existIndex = partners.findIndex((p) => candidate.id === p.user.id);
if (existIndex >= 0) {
partners[existIndex].sharedWithMe = true;
partners[existIndex].inTimeline = candidate.inTimeline ?? false;
} else {
if (existIndex === -1) {
partners = [
...partners,
{
@ -77,6 +74,9 @@
inTimeline: candidate.inTimeline ?? false,
},
];
} else {
partners[existIndex].sharedWithMe = true;
partners[existIndex].inTimeline = candidate.inTimeline ?? false;
}
}
};

View File

@ -43,7 +43,7 @@
let { keys = $bindable([]), sessions = $bindable([]) }: Props = $props();
let oauthOpen =
oauth.isCallback(window.location) ||
oauth.isCallback(globalThis.location) ||
$page.url.searchParams.get(QueryParameter.OPEN_SETTING) === OpenSettingQueryParameterValue.OAUTH;
</script>