Skip to content

Increase height and delete drivechain-launcher #42

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions public/chain_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
"wallet": ""
},
"extra_delete": [
"Library/AppData/Roaming/com.layertwolabs.bitwindow",
"Library/AppData/Roaming/com.example",
"AppData/Roaming/com.layertwolabs.bitwindow",
"AppData/Roaming/com.example",
".local/share/com.layertwolabs.bitwindow",
"Library/Application Support/com.layertwolabs.bitwindow",
"Library/Application Support/com.layertwolabs.launcher",
Expand Down
2 changes: 1 addition & 1 deletion public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function createWindow() {
// Create main window completely hidden
const options = {
width: 900,
height: 400,
height: 450,
show: false,
frame: true,
resizable: false,
Expand Down
23 changes: 23 additions & 0 deletions public/modules/chainManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ class ChainManager {
});
}

async cleanupLauncherData() {
try {

// Delete drivechain-launcher folder
const launcherPath = app.getPath('userData');
try {
await fs.remove(launcherPath);
console.log(`Removed drivechain-launcher directory: ${launcherPath}`);
} catch (error) {
console.log('Skipping folder deletion due to file in use');
}

return true;
} catch (error) {
console.error('Failed to cleanup BitWindow data:', error);
return false;
}
}

async isChainReady(chainId) {
const status = this.chainStatuses.get(chainId);
if (status !== 'running') return false;
Expand Down Expand Up @@ -720,6 +739,10 @@ class ChainManager {

await new Promise(resolve => setTimeout(resolve, 500));

const cleanupResult = await this.cleanupLauncherData();
if (!cleanupResult) {
console.error('Failed to cleanup Launcher data');
}
// Reset each chain's data
for (const id of chainsToReset) {
const chain = this.getChainConfig(id);
Expand Down
5 changes: 3 additions & 2 deletions src/components/SettingsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ const SettingsModal = ({ onResetComplete }) => {
// Delete wallet starters directory first
await window.electronAPI.invoke('delete-wallet-starters-dir');

// Recreate wallet starters directories
await window.electronAPI.invoke('init-wallet-dirs');


// Then handle chain resets
const chains = await window.electronAPI.getConfig();
Expand All @@ -143,6 +142,8 @@ const SettingsModal = ({ onResetComplete }) => {
}
}
setShowResetModal(false);
// Recreate wallet starters directories
await window.electronAPI.invoke('init-wallet-dirs');
handleClose(); // Close the settings modal after reset
onResetComplete(); // Show the welcome modal
} catch (error) {
Expand Down