MCPcopy Create free account
hub / github.com/ScattrdBlade/bigFileUpload / handleShareXFileUpload

Function handleShareXFileUpload

settings.tsx:744–763  ·  view source on GitHub ↗
(event: React.ChangeEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

742 };
743
744 const handleShareXFileUpload = (event: React.ChangeEvent<HTMLInputElement>) => {
745 const file = event.target.files?.[0];
746 if (!file) return;
747
748 const reader = new FileReader();
749 reader.onload = (e: ProgressEvent<FileReader>) => {
750 try {
751 const content = String(e.target?.result || "");
752 const parsed = parseShareXConfig(content);
753 store.sharexConfig = JSON.stringify(parsed, null, 2);
754 update();
755 showToast("Imported ShareX config", Toasts.Type.SUCCESS);
756 } catch (error) {
757 const message = error instanceof Error ? error.message : "Failed to import ShareX config";
758 showToast(message, Toasts.Type.FAILURE);
759 }
760 };
761 reader.readAsText(file);
762 event.target.value = "";
763 };
764
765 return (
766 <>

Callers

nothing calls this directly

Calls 1

parseShareXConfigFunction · 0.90

Tested by

no test coverage detected