fix: eslint
This commit is contained in:
parent
b9fed0e340
commit
f367b56633
@ -1,4 +1,3 @@
|
||||
import { ImageInfo } from '$lib/image/domain/entity/imageInfo';
|
||||
import z from 'zod';
|
||||
|
||||
export const ImageInfoResponseSchema = z.object({
|
||||
|
@ -27,7 +27,7 @@ export class ImageBloc {
|
||||
private async uploadImage(file: File): Promise<ImageInfoState> {
|
||||
this.state.set({ status: StatusType.Loading, data: get(this.state).data });
|
||||
|
||||
var result: ImageInfoState;
|
||||
let result: ImageInfoState;
|
||||
try {
|
||||
const imageInfo = await this.uploadImageUseCase.execute(file);
|
||||
const imageInfoViewModel = ImageInfoViewModel.fromEntity(imageInfo);
|
||||
@ -36,7 +36,6 @@ export class ImageBloc {
|
||||
result = { status: StatusType.Error, error: error as Error };
|
||||
}
|
||||
|
||||
this.state.set(result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,13 @@
|
||||
const imageInfo = state.data;
|
||||
console.log('Image URL', imageInfo.url.href);
|
||||
|
||||
let copiedToClipboard = false;
|
||||
let copiedToClipboard: boolean;
|
||||
try {
|
||||
await navigator.clipboard.writeText(imageInfo.url.href);
|
||||
copiedToClipboard = true;
|
||||
} catch (error) {}
|
||||
} catch {
|
||||
copiedToClipboard = false;
|
||||
}
|
||||
|
||||
toast.success(`Image uploaded successfully with ID: ${imageInfo.id}`, {
|
||||
description: copiedToClipboard
|
||||
|
Loading…
x
Reference in New Issue
Block a user