refactor: auth manager (#27638)

This commit is contained in:
Jason Rasmussen
2026-04-14 08:49:24 -04:00
committed by GitHub
parent daed3f0966
commit 1ba0989e15
77 changed files with 387 additions and 379 deletions
+2 -3
View File
@@ -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;
}