logseq import plugin

This commit is contained in:
th committed 2026-04-11 01:45:36 +02:00
1 parent 3ae84ccdd7
commit 5af49655d6
11 files changed
+301 -193

No files matched your search

+6
View File
@@ -44,6 +44,8 @@ function render(list) {
});
}
let reloadTimer = null;
async function onToggle(e) {
const input = e.currentTarget;
const name = input.dataset.name;
@@ -58,6 +60,10 @@ async function onToggle(e) {
pluginsCache = res.plugins;
dirtyAfterToggle = true;
$('plugins-reload-notice')?.classList.remove('hidden');
// Auto-reload so the effect of the toggle is visible immediately.
// Debounced so rapid successive toggles only trigger one reload.
if (reloadTimer) clearTimeout(reloadTimer);
reloadTimer = setTimeout(() => location.reload(), 400);
} catch (err) {
// Revert UI on failure
input.checked = !enabled;