mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: auth manager (#27638)
This commit is contained in:
@@ -2,7 +2,6 @@ import { authManager } from '$lib/managers/auth-manager.svelte';
|
||||
import { uploadManager } from '$lib/managers/upload-manager.svelte';
|
||||
import { addAssetsToAlbums } from '$lib/services/album.service';
|
||||
import { uploadAssetsStore } from '$lib/stores/upload';
|
||||
import { user } from '$lib/stores/user.store';
|
||||
import { UploadState } from '$lib/types';
|
||||
import { uploadRequest } from '$lib/utils';
|
||||
import { ExecutorQueue } from '$lib/utils/executor-queue';
|
||||
@@ -145,7 +144,7 @@ async function fileUploader({
|
||||
}: FileUploaderParams): Promise<string | undefined> {
|
||||
const fileCreatedAt = new Date(assetFile.lastModified).toISOString();
|
||||
const $t = get(t);
|
||||
const wasInitiallyLoggedIn = !!get(user);
|
||||
const wasInitiallyLoggedIn = !!authManager.authenticated;
|
||||
|
||||
uploadAssetsStore.markStarted(deviceAssetId);
|
||||
|
||||
@@ -238,7 +237,7 @@ async function fileUploader({
|
||||
} catch (error) {
|
||||
// If the user store no longer holds a user, it means they have logged out
|
||||
// In this case don't bother reporting any errors.
|
||||
if (wasInitiallyLoggedIn && !get(user)) {
|
||||
if (wasInitiallyLoggedIn && !authManager.authenticated) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user