mani-calc 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ui/floating-search.js +13 -2
package/package.json
CHANGED
|
@@ -67,19 +67,24 @@ class FloatingSearchBox {
|
|
|
67
67
|
setupIPC() {
|
|
68
68
|
// Handle query from renderer
|
|
69
69
|
ipcMain.on('process-query', async (event, query) => {
|
|
70
|
+
console.log('Processing query:', query);
|
|
70
71
|
try {
|
|
71
72
|
// Check for system commands first
|
|
72
73
|
const systemResult = await this.handleSystemCommand(query);
|
|
73
74
|
if (systemResult) {
|
|
75
|
+
console.log('System command executed:', systemResult);
|
|
74
76
|
event.reply('query-result', systemResult);
|
|
75
77
|
setTimeout(() => this.hide(), 1000);
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
// Process as calculation
|
|
82
|
+
console.log('Calculating...');
|
|
80
83
|
const result = await this.maniCalc.processQuery(query);
|
|
84
|
+
console.log('Calculation result:', result);
|
|
81
85
|
event.reply('query-result', result);
|
|
82
86
|
} catch (error) {
|
|
87
|
+
console.error('Error processing query:', error);
|
|
83
88
|
event.reply('query-result', {
|
|
84
89
|
error: error.message,
|
|
85
90
|
type: 'error'
|
|
@@ -245,8 +250,14 @@ class FloatingSearchBox {
|
|
|
245
250
|
|
|
246
251
|
destroy() {
|
|
247
252
|
if (this.window) {
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
try {
|
|
254
|
+
globalShortcut.unregister(this.hotkey);
|
|
255
|
+
if (!this.window.isDestroyed()) {
|
|
256
|
+
this.window.close();
|
|
257
|
+
}
|
|
258
|
+
} catch (err) {
|
|
259
|
+
console.error('Error destroying window:', err);
|
|
260
|
+
}
|
|
250
261
|
this.window = null;
|
|
251
262
|
}
|
|
252
263
|
}
|