Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: alert if app data directory canot be found as boot will fail #1813

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading