summaryrefslogtreecommitdiff
path: root/web/js/admin.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/admin.js')
-rw-r--r--web/js/admin.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/js/admin.js b/web/js/admin.js
index 86ad471..ac43643 100644
--- a/web/js/admin.js
+++ b/web/js/admin.js
@@ -1,5 +1,6 @@
import { API } from './api.js';
import { escapeHtml, toast } from './utils.js';
+import { triggerRescan } from './views/admin-status.js';
export function initAdmin() {
const btn = document.getElementById('admin-toggle');
@@ -18,8 +19,7 @@ export function initAdmin() {
rescanBtn?.addEventListener('click', async () => {
rescanBtn.disabled = true;
- try { await API.rescan(); toast('Rescan triggered'); }
- catch (err) { toast(err.message, 'error'); }
+ try { await triggerRescan(); }
finally { rescanBtn.disabled = false; }
});