mrmd-server 0.1.10 → 0.1.11
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/static/http-shim.js +20 -1
package/package.json
CHANGED
package/static/http-shim.js
CHANGED
|
@@ -215,7 +215,26 @@
|
|
|
215
215
|
// File scanning
|
|
216
216
|
// ========================================================================
|
|
217
217
|
|
|
218
|
-
scanFiles: (searchDir) =>
|
|
218
|
+
scanFiles: (searchDir) => {
|
|
219
|
+
// Trigger scan and emit results via onFilesUpdate (matches electron behavior)
|
|
220
|
+
GET(`/api/file/scan?root=${encodeURIComponent(searchDir || '')}`)
|
|
221
|
+
.then(files => {
|
|
222
|
+
// Emit files-update event with the results
|
|
223
|
+
const handlers = eventHandlers['files-update'];
|
|
224
|
+
if (handlers) {
|
|
225
|
+
handlers.forEach(cb => {
|
|
226
|
+
try {
|
|
227
|
+
cb({ files });
|
|
228
|
+
} catch (err) {
|
|
229
|
+
console.error('[http-shim] files-update handler error:', err);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
.catch(err => {
|
|
235
|
+
console.error('[http-shim] scanFiles error:', err);
|
|
236
|
+
});
|
|
237
|
+
},
|
|
219
238
|
|
|
220
239
|
onFilesUpdate: (callback) => {
|
|
221
240
|
eventHandlers['files-update'].push(callback);
|