From 3ba4d11804d40a208170c347c5db2c1660c316c0 Mon Sep 17 00:00:00 2001 From: Richard Guay Date: Sat, 17 Dec 2022 15:26:00 +0700 Subject: [PATCH] Fixing some point of locking up the code. --- frontend/src/components/FileManager.svelte | 68 ++++++++++++---------- frontend/src/components/GitHub.svelte | 6 +- frontend/src/modules/OS.js | 2 +- 3 files changed, 40 insertions(+), 36 deletions(-) diff --git a/frontend/src/components/FileManager.svelte b/frontend/src/components/FileManager.svelte index a0158e0..5bb903e 100644 --- a/frontend/src/components/FileManager.svelte +++ b/frontend/src/components/FileManager.svelte @@ -1589,7 +1589,7 @@ } async function deleteEntriesCommand(entries) { - msgBoxConfig = { +/* msgBoxConfig = { title: "Deleting Entries", noShowButton: true, }; @@ -1610,44 +1610,47 @@ showMessageBox = false; }; addSpinner("progress1", 1); - // // It is all set up. Show the message box. // showMessageBox = true; +*/ for (var i = 0; i < entries.length; i++) { - updateSpinner("progress1", ((i + 1) / entries.length) * 100); +// updateSpinner("progress1", ((i + 1) / entries.length) * 100); await entries[i].fileSystem.deleteEntries(entries[i], (err, stdout) => { if (err) { - updateSpinner("progress1", 100); +// updateSpinner("progress1", 100); refreshPanes(); // // Remove the spinner from being checked. // - clearSpinners(); +// clearSpinners(); } if (i === (entries.length - 1)) { - showMessageBox = false; - $keyProcess = true; - - // - // Refresh the side deleted from. - // - if (localCurrentCursor.pane === "left") { - refreshLeftPane(); - } else { - refreshRightPane(); - } +// showMessageBox = false; // // Remove the spinner from being checked. // - removeSpinner("progress1"); +// removeSpinner("progress1"); } }); } + // + // Refresh the side deleted from. + // + if (localCurrentCursor.pane === "left") { + refreshLeftPane(); + } else { + refreshRightPane(); + } + + // + // Make sure key processing is on. + // + $keyProcess = true; } function copyEntries() { @@ -1671,7 +1674,7 @@ } async function copyEntriesCommand(entries, otherPane, sel) { - msgBoxConfig = { +/* msgBoxConfig = { title: "Copying Entries", noShowButton: true, }; @@ -1697,23 +1700,23 @@ // It is all set up. Show the message box. // showMessageBox = true; - +*/ for (var i = 0; i < entries.length; i++) { - updateSpinner("progress1", ((i + 1) / entries.length) * 100); +// updateSpinner("progress1", ((i + 1) / entries.length) * 100); await entries[i].fileSystem.copyEntries( entries[i], otherPane, (err, stdout) => { if (err) { - updateSpinner("progress1", 100); +// updateSpinner("progress1", 100); refreshPanes(); // // Remove the spinner from being checked. // - clearSpinners(); +// clearSpinners(); } else if (i === (entries.length - 1)) { - showMessageBox = false; +// showMessageBox = false; $keyProcess = true; // @@ -1733,7 +1736,7 @@ // // Remove the spinner from being checked. // - removeSpinner("progress1"); +// removeSpinner("progress1"); } } ); @@ -1846,7 +1849,7 @@ } async function moveEntriesCommand(entries, otherPane) { - msgBoxConfig = { +/* msgBoxConfig = { title: "Moving Entries", noShowButton: true, }; @@ -1872,15 +1875,15 @@ // It is all set up. Show the message box. // showMessageBox = true; - +*/ for (var i = 0; i < entries.length; i++) { - updateSpinner("progress1", ((i + 1) / entries.length) * 100); +// updateSpinner("progress1", ((i + 1) / entries.length) * 100); await entries[i].fileSystem.moveEntries( entries[i], otherPane, (err, stdout) => { if (err) { - updateSpinner("progress1", 100); +// updateSpinner("progress1", 100); // // Refresh both sides. @@ -1890,10 +1893,9 @@ // // Remove the spinner from being checked. // - clearSpinners(); +// clearSpinners(); } else if (i === (entries.length - 1)) { - showMessageBox = false; - $keyProcess = true; +// showMessageBox = false; // // Refresh both sides. @@ -1903,11 +1905,13 @@ // // Remove the spinner from being checked. // - removeSpinner("progress1"); +// removeSpinner("progress1"); } } ); } + refreshPanes(); + $keyProcess = true; } async function refreshRightPane() { diff --git a/frontend/src/components/GitHub.svelte b/frontend/src/components/GitHub.svelte index 37a8071..9ad48ea 100644 --- a/frontend/src/components/GitHub.svelte +++ b/frontend/src/components/GitHub.svelte @@ -5,7 +5,6 @@ import { config } from "../stores/config.js"; import { keyProcess } from "../stores/keyProcess.js"; import util from "../modules/util.js"; -// import { Octokit } from "@octokit/rest"; const dispatch = createEventDispatcher(); @@ -23,9 +22,10 @@ onMount(async () => { keyProcess.set(false); width = window.innerWidth - 30; - // octok = new Octokit(); -// await loadRepoInfo(); timeOut = setTimeout(focusInput, 1000); + // + // #TODO - change the GitHub queries to the golang since Octokit no longer works. + // return () => { hiddenInput = null; clearTimeout(timeOut); diff --git a/frontend/src/modules/OS.js b/frontend/src/modules/OS.js index 0b71012..94710cb 100644 --- a/frontend/src/modules/OS.js +++ b/frontend/src/modules/OS.js @@ -184,7 +184,7 @@ var OS = { // Move the entries. // await App.MoveEntries(fromName, toName); - var err = await GetError(); + var err = await App.GetError(); // // Run the callback if given.