remove unnecessary store

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