Skip to content

Commit ce71cc0

Browse files
author
FileShot
committed
fix: Make tool panels actually functional, fix app close behavior
1 parent cefd631 commit ce71cc0

2 files changed

Lines changed: 11 additions & 22 deletions

File tree

main.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const store = new Store();
1616
let mainWindow = null;
1717
let tray = null;
1818
let uploadQueue = [];
19+
let isQuitting = false;
1920

2021
// App configuration
2122
const isDev = process.argv.includes('--dev');
@@ -184,22 +185,10 @@ function createWindow() {
184185
mainWindow.show();
185186
});
186187

187-
// Handle window close - minimize to tray instead
188+
// Handle window close - allow actual close, don't prevent it
188189
mainWindow.on('close', (event) => {
189-
if (!app.isQuitting) {
190-
event.preventDefault();
191-
mainWindow.hide();
192-
193-
// Show notification
194-
// NOTE: tray.displayBalloon is Windows-only.
195-
if (tray && process.platform === 'win32' && typeof tray.displayBalloon === 'function') {
196-
tray.displayBalloon({
197-
title: 'FileShot',
198-
content: 'FileShot is still running in the background. Click the tray icon to open.',
199-
icon: path.join(__dirname, 'assets', 'icon.png')
200-
});
201-
}
202-
}
190+
// Allow the window to close normally
191+
// Don't minimize to tray on close
203192
});
204193

205194
// Handle external links
@@ -830,7 +819,7 @@ app.on('activate', () => {
830819
});
831820

832821
app.on('before-quit', () => {
833-
app.isQuitting = true;
822+
isQuitting = true;
834823
});
835824

836825
// Handle uncaught exceptions

renderer/local/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const DOM = {
3636
dropZoneText: () => document.querySelector('.drop-zone-text'),
3737

3838
// Tool panels
39-
toolPanel: (toolName) => document.getElementById(`${toolName}-panel`),
39+
toolPanel: (toolName) => document.getElementById(`tool-${toolName}`),
4040

4141
// Specific tools
4242
vaultAddBtn: () => document.getElementById('addFilesBtn'),
@@ -128,13 +128,13 @@ function switchToTool(toolName) {
128128

129129
// Hide all panels
130130
document.querySelectorAll('.tool-panel').forEach(panel => {
131-
panel.style.display = 'none';
131+
panel.hidden = true;
132132
});
133133

134-
// Show selected panel
135-
const panel = DOM.toolPanel(toolName);
134+
// Show selected panel - ID is tool-{name}
135+
const panel = document.getElementById(`tool-${toolName}`);
136136
if (panel) {
137-
panel.style.display = 'block';
137+
panel.hidden = false;
138138
}
139139

140140
// Update topbar title with icons
@@ -479,7 +479,7 @@ function initSettingsTool() {
479479
function initToolPanels() {
480480
// Initialize all tool panels visibility
481481
document.querySelectorAll('.tool-panel').forEach(panel => {
482-
panel.style.display = 'none';
482+
panel.hidden = true;
483483
});
484484
}
485485

0 commit comments

Comments
 (0)