mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
feat: view the user's app version on the user page (#21345)
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
|
||||
const refresh = () => getSessions().then((_devices) => (devices = _devices));
|
||||
|
||||
let currentDevice = $derived(devices.find((device) => device.current));
|
||||
let otherDevices = $derived(devices.filter((device) => !device.current));
|
||||
let currentSession = $derived(devices.find((device) => device.current));
|
||||
let otherSessions = $derived(devices.filter((device) => !device.current));
|
||||
|
||||
const handleDelete = async (device: SessionResponseDto) => {
|
||||
const isConfirmed = await modalManager.showDialog({ prompt: $t('logout_this_device_confirmation') });
|
||||
@@ -54,22 +54,22 @@
|
||||
</script>
|
||||
|
||||
<section class="my-4">
|
||||
{#if currentDevice}
|
||||
{#if currentSession}
|
||||
<div class="mb-6">
|
||||
<h3 class="uppercase mb-2 text-xs font-medium text-primary">
|
||||
{$t('current_device')}
|
||||
</h3>
|
||||
<DeviceCard device={currentDevice} />
|
||||
<DeviceCard session={currentSession} />
|
||||
</div>
|
||||
{/if}
|
||||
{#if otherDevices.length > 0}
|
||||
{#if otherSessions.length > 0}
|
||||
<div class="mb-6">
|
||||
<h3 class="uppercase mb-2 text-xs font-medium text-primary">
|
||||
{$t('other_devices')}
|
||||
</h3>
|
||||
{#each otherDevices as device, index (device.id)}
|
||||
<DeviceCard {device} onDelete={() => handleDelete(device)} />
|
||||
{#if index !== otherDevices.length - 1}
|
||||
{#each otherSessions as session, index (session.id)}
|
||||
<DeviceCard {session} onDelete={() => handleDelete(session)} />
|
||||
{#if index !== otherSessions.length - 1}
|
||||
<hr class="my-3" />
|
||||
{/if}
|
||||
{/each}
|
||||
|
||||
Reference in New Issue
Block a user