Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,8 @@

let cursorVisible = $state(true);

const clientIdentifier = page.url.searchParams.get('client');
const authsecret = page.url.searchParams.get('authsecret');

if (clientIdentifier && clientIdentifier != $clientIdentifierStore) {
clientIdentifierStore.set(clientIdentifier);
}

if (authsecret && authsecret != $authSecretStore) {
authSecretStore.set(authsecret);
api.init();
Expand Down Expand Up @@ -137,7 +132,7 @@

async function loadAssets() {
try {
let assetRequest = await api.getAssets();
let assetRequest = await api.getAssets({ clientIdentifier: $clientIdentifierStore });

if (assetRequest.status != 200) {
if (assetRequest.status == 401) {
Expand Down
12 changes: 10 additions & 2 deletions immichFrame.Web/src/routes/+page.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import * as api from '$lib/immichFrameApi';
import { configStore } from '$lib/stores/config.store.js'
import { clientIdentifierStore } from '$lib/stores/persist.store';
import { get } from 'svelte/store';
import type { PageLoad } from './$types';

export const load = async () => {
export const load: PageLoad = async ({ url }) => {

const configRequest = await api.getConfig({ clientIdentifier: "" });
const clientParam = url.searchParams.get('client');
if (clientParam) {
clientIdentifierStore.set(clientParam);
}

const configRequest = await api.getConfig({ clientIdentifier: get(clientIdentifierStore) });

const config = configRequest.data;

Expand Down
Loading