fix(watermark): clear uploaded PDF and watermark inputs after download

This commit is contained in:
JAINAM576
2025-10-21 11:57:46 +05:30
parent 11c9e14803
commit 2b85a759af
2 changed files with 238 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ import {
readFileAsArrayBuffer,
hexToRgb,
} from '../utils/helpers.js';
import { state } from '../state.js';
import { state , resetState } from '../state.js';
import {
PDFDocument as PDFLibDocument,
@@ -175,6 +175,16 @@ export async function addWatermark() {
new Blob([newPdfBytes], { type: 'application/pdf' }),
'watermarked.pdf'
);
const toolid = state.activeTool;
resetState();
if (toolid) {
const element = document.querySelector(
`[data-tool-id="${toolid}"]`
) as HTMLElement;
if (element) element.click();
}
} catch (e) {
console.error(e);
showAlert(