Send progress in main view

This commit is contained in:
N-Pex 2025-08-20 15:12:04 +02:00
parent 41232fbd90
commit e9accdebf1
11 changed files with 465 additions and 86 deletions

View file

@ -1,5 +1,5 @@
import { ComputedRef, Ref } from "vue";
import { Proof } from "./proof";
import { Proof, ProofHintFlags } from "./proof";
export class UploadPromise<Type> {
wrappedPromise: Promise<Type>;
@ -39,6 +39,7 @@ export type AttachmentSendInfo = {
randomRotation: number; // For UI effects
randomTranslationX: number; // For UI effects
randomTranslationY: number; // For UI effects
proofHintFlags?: ProofHintFlags;
};
export type AttachmentThumbnail = {
@ -58,15 +59,15 @@ export type Attachment = {
useScaled: boolean;
src?: string;
proof?: Proof;
sendInfo?: AttachmentSendInfo;
thumbnail?: AttachmentThumbnail;
sendInfo: AttachmentSendInfo;
};
export type AttachmentBatch = {
sendingStatus: Ref<"initial" | "sending" | "sent" | "canceled" | "failed">;
sendingStatus: Ref<AttachmentSendStatus>;
sendingRootEventId: Ref<string | undefined>;
sendingPromise: Ref<Promise<any> | undefined>;
attachments: Ref<Attachment[]>;
progressPercent: Ref<number>;
attachments: Attachment[];
attachmentsSentCount: ComputedRef<number>;
attachmentsSending: ComputedRef<Attachment[]>;
attachmentsSent: ComputedRef<Attachment[]>;
@ -78,4 +79,3 @@ export type AttachmentBatch = {
cancel: () => void;
cancelSendAttachment: (attachment: Attachment) => void;
};