Undo clipboard reading
This commit is contained in:
@@ -173,22 +173,6 @@ const BatchTransactionForm: React.FC<BatchTransactionFormProps> = ({ onClose, on
|
|||||||
setTransactionGroups(groups);
|
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) => {
|
const handleAssignJob = (groupIndex: number, jobId: string) => {
|
||||||
setTransactionGroups(prev => {
|
setTransactionGroups(prev => {
|
||||||
const newGroups = [...prev];
|
const newGroups = [...prev];
|
||||||
|
|||||||
@@ -262,27 +262,7 @@ const Index = () => {
|
|||||||
<SalesTaxConfig />
|
<SalesTaxConfig />
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={async () => {
|
onClick={() => setShowBatchForm(true)}
|
||||||
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);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className="border-gray-600 hover:bg-gray-800"
|
className="border-gray-600 hover:bg-gray-800"
|
||||||
>
|
>
|
||||||
<FileText className="w-4 h-4 mr-2" />
|
<FileText className="w-4 h-4 mr-2" />
|
||||||
|
|||||||
Reference in New Issue
Block a user