This commit is contained in:
oqyude committed 2026-07-24 22:45:07 +03:00
1 parent 055edc7750
commit 7443ec059f
4 files changed
+13 -17

No files matched your search

+6 -8
View File
@@ -75,12 +75,16 @@ export class AttachmentCleanPasteModule extends BaseModule {
files: FileList,
editor: Editor,
settings: AttachmentCleanPasteSettings,
evt: ClipboardEvent | DragEvent,
): Promise<void> {
const matchingFiles = Array.from(files).filter((f) =>
this.shouldProcess(f.name, settings),
);
if (matchingFiles.length === 0) return;
evt.preventDefault();
evt.stopPropagation();
const links: string[] = [];
for (const file of matchingFiles) {
const link = await this.processFile(file, settings);
@@ -100,10 +104,7 @@ export class AttachmentCleanPasteModule extends BaseModule {
const files = evt.clipboardData?.files;
if (!files || files.length === 0) return;
evt.preventDefault();
evt.stopPropagation();
await this.processAll(files, editor, settings);
await this.processAll(files, editor, settings, evt);
};
}
@@ -116,10 +117,7 @@ export class AttachmentCleanPasteModule extends BaseModule {
const files = evt.dataTransfer?.files;
if (!files || files.length === 0) return;
evt.preventDefault();
evt.stopPropagation();
await this.processAll(files, editor, settings);
await this.processAll(files, editor, settings, evt);
};
}