Undo clipboard reading

This commit is contained in:
2025-07-08 12:50:49 +02:00
parent 135ce5d8fa
commit 965ac51c59
2 changed files with 1 additions and 37 deletions

View File

@@ -173,22 +173,6 @@ const BatchTransactionForm: React.FC<BatchTransactionFormProps> = ({ onClose, on
setTransactionGroups(groups);
};
// Read clipboard on mount
useEffect(() => {
const readClipboard = async () => {
try {
const text = await navigator.clipboard.readText();
if (text.trim()) {
setPastedData(text);
handlePaste(text);
}
} catch (err) {
// Clipboard reading failed, ignore silently
}
};
readClipboard();
}, []);
const handleAssignJob = (groupIndex: number, jobId: string) => {
setTransactionGroups(prev => {
const newGroups = [...prev];

View File

@@ -262,27 +262,7 @@ const Index = () => {
<SalesTaxConfig />
<Button
variant="outline"
onClick={async () => {
try {
const text = await navigator.clipboard.readText();
if (text.trim()) {
setShowBatchForm(true);
// Pass clipboard data to form
setTimeout(() => {
const textarea = document.querySelector('textarea[placeholder*="Paste your EVE transaction data"]') as HTMLTextAreaElement;
if (textarea) {
textarea.value = text;
textarea.dispatchEvent(new Event('input', { bubbles: true }));
}
}, 100);
} else {
setShowBatchForm(true);
}
} catch (err) {
// Clipboard reading failed, just open the form
setShowBatchForm(true);
}
}}
onClick={() => setShowBatchForm(true)}
className="border-gray-600 hover:bg-gray-800"
>
<FileText className="w-4 h-4 mr-2" />