Skip to content

Commit

Permalink
Fixing some point of locking up the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
raguay committed Dec 17, 2022
1 parent 01f9ee0 commit 3ba4d11
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
68 changes: 36 additions & 32 deletions frontend/src/components/FileManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@
}
async function deleteEntriesCommand(entries) {
msgBoxConfig = {
/* msgBoxConfig = {
title: "Deleting Entries",
noShowButton: true,
};
Expand All @@ -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() {
Expand All @@ -1671,7 +1674,7 @@
}
async function copyEntriesCommand(entries, otherPane, sel) {
msgBoxConfig = {
/* msgBoxConfig = {
title: "Copying Entries",
noShowButton: true,
};
Expand All @@ -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;
//
Expand All @@ -1733,7 +1736,7 @@
//
// Remove the spinner from being checked.
//
removeSpinner("progress1");
// removeSpinner("progress1");
}
}
);
Expand Down Expand Up @@ -1846,7 +1849,7 @@
}
async function moveEntriesCommand(entries, otherPane) {
msgBoxConfig = {
/* msgBoxConfig = {
title: "Moving Entries",
noShowButton: true,
};
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -1903,11 +1905,13 @@
//
// Remove the spinner from being checked.
//
removeSpinner("progress1");
// removeSpinner("progress1");
}
}
);
}
refreshPanes();
$keyProcess = true;
}
async function refreshRightPane() {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/GitHub.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/OS.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3ba4d11

Please sign in to comment.