remove unnecessary store
This commit is contained in:
parent
a83cbfd5ea
commit
bb692c1a8e
3 changed files with 1 additions and 13 deletions
|
@ -9,7 +9,6 @@
|
|||
export let publicSharedKey = '';
|
||||
import domtoimage from 'dom-to-image';
|
||||
import { notificationController, NotificationType } from './notification/notification';
|
||||
import { lastUpdatedProfilePicture } from '$lib/stores/preferences.store';
|
||||
|
||||
let profilePicture: HTMLDivElement;
|
||||
|
||||
|
@ -19,7 +18,6 @@
|
|||
const file: File = new File([blob], 'profile-picture.png', { type: 'image/png' });
|
||||
try {
|
||||
await api.userApi.createProfileImage({ file });
|
||||
lastUpdatedProfilePicture.set(Date.now());
|
||||
dispatch('close');
|
||||
notificationController.show({
|
||||
type: NotificationType.Info,
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<script lang="ts">
|
||||
import { imageLoad } from '$lib/utils/image-load';
|
||||
import { api, UserResponseDto } from '@api';
|
||||
import { lastUpdatedProfilePicture } from '$lib/stores/preferences.store';
|
||||
|
||||
export let user: UserResponseDto;
|
||||
export let color: Color = 'primary';
|
||||
|
@ -16,13 +15,6 @@
|
|||
export let showTitle = true;
|
||||
export let autoColor = false;
|
||||
let showFallback = true;
|
||||
let appendix = '';
|
||||
|
||||
lastUpdatedProfilePicture.subscribe((value) => {
|
||||
if (value) {
|
||||
appendix = '?d=' + value;
|
||||
}
|
||||
});
|
||||
|
||||
const colorClasses: Record<Color, string> = {
|
||||
primary: 'bg-immich-primary dark:bg-immich-dark-primary text-immich-dark-fg dark:text-immich-fg',
|
||||
|
@ -63,7 +55,7 @@
|
|||
>
|
||||
{#if user.profileImagePath}
|
||||
<img
|
||||
src={api.getProfileImageUrl(user.id) + appendix}
|
||||
src={api.getProfileImageUrl(user.id)}
|
||||
alt="Profile image of {title}"
|
||||
class="object-cover w-full h-full"
|
||||
class:hidden={showFallback}
|
||||
|
|
|
@ -46,5 +46,3 @@ export interface AlbumViewSettings {
|
|||
export const albumViewSettings = persisted<AlbumViewSettings>('album-view-settings', {
|
||||
sortBy: 'Most recent photo',
|
||||
});
|
||||
|
||||
export const lastUpdatedProfilePicture = persisted<number>('last-updated-profile-picture', 0, {});
|
||||
|
|
Loading…
Add table
Reference in a new issue