mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
Refactor web to use OpenAPI SDK (#326)
* Refactor main index page * Refactor admin page * Refactor Auth endpoint * Refactor directory to prep for monorepo * Fixed refactoring path * Resolved file path in vite * Refactor photo index page * Refactor thumbnail * Fixed test * Refactor Video Viewer component * Refactor download file * Refactor navigation bar * Refactor upload file check * Simplify Upload Asset signature * PR feedback
This commit is contained in:
parent
7f236c5b18
commit
9a6dfacf9b
55 changed files with 516 additions and 691 deletions
|
|
@ -1,13 +1,14 @@
|
|||
<script lang="ts">
|
||||
import { session } from '$app/stores';
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
import type { ImmichUser } from '$lib/models/immich-user';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { fade, fly, slide } from 'svelte/transition';
|
||||
import { postRequest } from '../../api';
|
||||
import { serverEndpoint } from '../../constants';
|
||||
import TrayArrowUp from 'svelte-material-icons/TrayArrowUp.svelte';
|
||||
import { clickOutside } from './click-outside';
|
||||
import { api } from '@api';
|
||||
|
||||
export let user: ImmichUser;
|
||||
|
||||
|
|
@ -16,12 +17,22 @@
|
|||
|
||||
const dispatch = createEventDispatcher();
|
||||
let shouldShowAccountInfoPanel = false;
|
||||
onMount(async () => {
|
||||
const res = await fetch(`${serverEndpoint}/user/profile-image/${user.id}`, { method: 'GET' });
|
||||
|
||||
if (res.status == 200) shouldShowProfileImage = true;
|
||||
onMount(() => {
|
||||
getUserProfileImage();
|
||||
});
|
||||
|
||||
const getUserProfileImage = async () => {
|
||||
if ($session.user) {
|
||||
try {
|
||||
await api.userApi.getProfileImage(user.id);
|
||||
shouldShowProfileImage = true;
|
||||
} catch (e) {
|
||||
console.log('User does not have a profile image');
|
||||
shouldShowProfileImage = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
const getFirstLetter = (text?: string) => {
|
||||
return text?.charAt(0).toUpperCase();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue