Ver Fonte

remove unnecessary store

Paul Paffe há 2 anos atrás
pai
commit
bb692c1a8e

+ 0 - 2
web/src/lib/components/shared-components/profile-image-cropper.svelte

@@ -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,

+ 1 - 9
web/src/lib/components/shared-components/user-avatar.svelte

@@ -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}

+ 0 - 2
web/src/lib/stores/preferences.store.ts

@@ -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, {});