Update file handling logic in App.tsx
This commit is contained in:
@@ -84,9 +84,7 @@ export default function App() {
|
|||||||
getCurrentWindow()
|
getCurrentWindow()
|
||||||
.onDragDropEvent(async (event) => {
|
.onDragDropEvent(async (event) => {
|
||||||
if (event.payload.type !== "drop") return;
|
if (event.payload.type !== "drop") return;
|
||||||
const [path] = event.payload.paths ?? [];
|
await handleFilePaths(event.payload.paths ?? []);
|
||||||
if (!path || !path.toLowerCase().endsWith(".txt")) return;
|
|
||||||
await createTextFromFile(path);
|
|
||||||
})
|
})
|
||||||
.then((cleanup) => {
|
.then((cleanup) => {
|
||||||
unlisten = cleanup;
|
unlisten = cleanup;
|
||||||
|
|||||||
Reference in New Issue
Block a user