Skip to content

Commit

Permalink
chore: alert if app data directory canot be found as boot will fail
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Aug 27, 2024
1 parent d03ad05 commit bbdfb85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,18 @@
// some linux distros may not have Documents folder. so we use the home folder
// https://github.com/phcode-dev/phoenix/issues/1729
window._tauriBootVars.documentDir = results[4].value;
} else {
console.error("unable to determine user documents dir, defaulting to app data dir documentdir:",
} else if(results[2].status === "fulfilled"){
console.error("Unable to determine user documents dir, defaulting to app data dir as document dir:",
results[1].reason, "home folder error: ", results[4].reason);
window._tauriBootVars.documentDir = results[2].value;
} else {
alert("Could not resolve user documents directory. \nPhoenix Code cannot start.");
}

if(results[2].status === "fulfilled") {
window._tauriBootVars.appLocalDir = results[2].value;
} else {
alert("Could not resolve Application Data directory. \nPhoenix Code cannot start.");
}

// For tests, documents dir is localAppDataDir/testDocuments to keep user documents garbage free for tests
Expand Down
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ function confirmReload(title, message) {
});
copyButton.textContent = 'Copy Error';
getHelpButton.textContent = 'Get Help';
reloadButton.textContent = 'Reload Page';

reloadButton.textContent = 'Restart App';
// Styling for visibility
// Define common styles for buttons
const buttonStyles = {
Expand Down

0 comments on commit bbdfb85

Please sign in to comment.