mirror of
https://github.com/immich-app/immich.git
synced 2026-03-22 07:09:58 +03:00
properly reload settings
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
mdiServerOutline,
|
mdiServerOutline,
|
||||||
mdiTwoFactorAuthentication,
|
mdiTwoFactorAuthentication,
|
||||||
} from '@mdi/js';
|
} from '@mdi/js';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import SettingAccordionState from '../shared-components/settings/setting-accordion-state.svelte';
|
import SettingAccordionState from '../shared-components/settings/setting-accordion-state.svelte';
|
||||||
import SettingAccordion from '../shared-components/settings/setting-accordion.svelte';
|
import SettingAccordion from '../shared-components/settings/setting-accordion.svelte';
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
import PartnerSettings from './partner-settings.svelte';
|
import PartnerSettings from './partner-settings.svelte';
|
||||||
import UserAPIKeyList from './user-api-key-list.svelte';
|
import UserAPIKeyList from './user-api-key-list.svelte';
|
||||||
import UserProfileSettings from './user-profile-settings.svelte';
|
import UserProfileSettings from './user-profile-settings.svelte';
|
||||||
import { onMount } from 'svelte';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
sessions?: SessionResponseDto[];
|
sessions?: SessionResponseDto[];
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
keys = await getApiKeys();
|
keys = await getApiKeys();
|
||||||
})
|
});
|
||||||
|
|
||||||
let oauthOpen =
|
let oauthOpen =
|
||||||
oauth.isCallback(globalThis.location) ||
|
oauth.isCallback(globalThis.location) ||
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import UserSettingsList from '$lib/components/user-settings-page/user-settings-list.svelte';
|
|
||||||
import { getKeyboardActions } from '$lib/services/keyboard.service';
|
import { getKeyboardActions } from '$lib/services/keyboard.service';
|
||||||
import { Container } from '@immich/ui';
|
import { Container } from '@immich/ui';
|
||||||
|
import type { Snippet } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import type { Snippet } from 'svelte';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children?: Snippet;
|
children?: Snippet;
|
||||||
@@ -19,8 +18,6 @@
|
|||||||
|
|
||||||
<UserPageLayout title={data.meta.title} actions={[KeyboardShortcuts]}>
|
<UserPageLayout title={data.meta.title} actions={[KeyboardShortcuts]}>
|
||||||
<Container size="medium" center>
|
<Container size="medium" center>
|
||||||
<UserSettingsList sessions={data.sessions} />
|
|
||||||
|
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</Container>
|
</Container>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
import { authenticate } from '$lib/utils/auth';
|
import { authenticate } from '$lib/utils/auth';
|
||||||
import { getFormatter } from '$lib/utils/i18n';
|
import { getFormatter } from '$lib/utils/i18n';
|
||||||
import { getSessions } from '@immich/sdk';
|
|
||||||
import type { PageLoad } from './$types';
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
export const load = (async ({ url }) => {
|
export const load = (async ({ url }) => {
|
||||||
await authenticate(url);
|
await authenticate(url);
|
||||||
|
|
||||||
const sessions = await getSessions();
|
|
||||||
const $t = await getFormatter();
|
const $t = await getFormatter();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
sessions,
|
|
||||||
meta: {
|
meta: {
|
||||||
title: $t('settings'),
|
title: $t('settings'),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import UserSettingsList from '$lib/components/user-settings-page/user-settings-list.svelte';
|
||||||
|
import type { PageData } from './$types';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
data: PageData;
|
||||||
|
};
|
||||||
|
|
||||||
|
let { data }: Props = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<UserSettingsList sessions={data.sessions} />
|
||||||
|
|||||||
13
web/src/routes/(user)/user-settings/+page.ts
Normal file
13
web/src/routes/(user)/user-settings/+page.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { authenticate } from '$lib/utils/auth';
|
||||||
|
import { getSessions } from '@immich/sdk';
|
||||||
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
|
export const load = (async ({ url }) => {
|
||||||
|
await authenticate(url);
|
||||||
|
|
||||||
|
const sessions = await getSessions();
|
||||||
|
|
||||||
|
return {
|
||||||
|
sessions,
|
||||||
|
};
|
||||||
|
}) satisfies PageLoad;
|
||||||
Reference in New Issue
Block a user