fix format, unused vars
This commit is contained in:
@@ -1,20 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { AssetResponseDto, api } from '@api';
|
import { AssetResponseDto, api } from '@api';
|
||||||
import { createEventDispatcher, onMount } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import Plus from 'svelte-material-icons/Plus.svelte';
|
|
||||||
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
|
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
|
||||||
import BaseModal from './base-modal.svelte';
|
import BaseModal from './base-modal.svelte';
|
||||||
import { stringify } from 'postcss';
|
|
||||||
import Button from '../elements/buttons/button.svelte';
|
import Button from '../elements/buttons/button.svelte';
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
export let asset: AssetResponseDto;
|
export let asset: AssetResponseDto;
|
||||||
export let publicSharedKey = '';
|
export let publicSharedKey = '';
|
||||||
import domtoimage from 'dom-to-image';
|
import domtoimage from 'dom-to-image';
|
||||||
import type { UserResponseDto } from '@api';
|
|
||||||
import { notificationController, NotificationType } from './notification/notification';
|
import { notificationController, NotificationType } from './notification/notification';
|
||||||
import { lastUpdatedProfilePicture } from '$lib/stores/preferences.store';
|
import { lastUpdatedProfilePicture } from '$lib/stores/preferences.store';
|
||||||
|
|
||||||
let user: UserResponseDto;
|
|
||||||
let profilePicture: HTMLDivElement;
|
let profilePicture: HTMLDivElement;
|
||||||
|
|
||||||
const handleSetProfilePicture = async () => {
|
const handleSetProfilePicture = async () => {
|
||||||
@@ -22,14 +18,13 @@
|
|||||||
const blob: Blob = await domtoimage.toBlob(div);
|
const blob: Blob = await domtoimage.toBlob(div);
|
||||||
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 {
|
||||||
api.userApi.createProfileImage({ file }).then((res) => {
|
await api.userApi.createProfileImage({ file });
|
||||||
lastUpdatedProfilePicture.set(Date.now());
|
lastUpdatedProfilePicture.set(Date.now());
|
||||||
dispatch('close');
|
dispatch('close');
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
message: 'Profile picture set.',
|
message: 'Profile picture set.',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
});
|
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error [profile-image-cropper]:', err);
|
console.error('Error [profile-image-cropper]:', err);
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { persisted } from 'svelte-local-storage-store';
|
import { persisted } from 'svelte-local-storage-store';
|
||||||
import { writable } from 'svelte/store';
|
|
||||||
|
|
||||||
const initialTheme = browser && !window.matchMedia('(prefers-color-scheme: dark)').matches ? 'light' : 'dark';
|
const initialTheme = browser && !window.matchMedia('(prefers-color-scheme: dark)').matches ? 'light' : 'dark';
|
||||||
|
|
||||||
@@ -48,5 +47,4 @@ export const albumViewSettings = persisted<AlbumViewSettings>('album-view-settin
|
|||||||
sortBy: 'Most recent photo',
|
sortBy: 'Most recent photo',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const lastUpdatedProfilePicture = persisted<number>('last-updated-profile-picture', 0, {});
|
||||||
export const lastUpdatedProfilePicture = persisted<Number>('last-updated-profile-picture', 0, {});
|
|
||||||
|
|||||||
Reference in New Issue
Block a user