mirror of
https://github.com/immich-app/static-pages.git
synced 2026-09-30 13:23:05 +08:00
fix: redirect to updated instance url on save (#803)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { StorageKey } from '$lib';
|
||||
import { mergeInstanceUrl, StorageKey } from '$lib';
|
||||
import FullPageLayout from '$common/components/FullPageLayout.svelte';
|
||||
import {
|
||||
Button,
|
||||
@@ -41,7 +41,9 @@
|
||||
|
||||
localStorage.setItem(StorageKey.INSTANCE_URL, instanceUrl);
|
||||
if (targetUrl && instanceUrl) {
|
||||
location.assign(new URL(targetUrl, instanceUrl).href);
|
||||
const currentUrl = new URL(location.href);
|
||||
currentUrl.searchParams.delete('instanceUrl');
|
||||
location.assign(mergeInstanceUrl(currentUrl, instanceUrl).href);
|
||||
} else {
|
||||
saved = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user