mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-30 20:43:00 +00:00
Compare commits
1 Commits
fix/wifi-a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e6c40ad55 |
@@ -1165,9 +1165,11 @@ function initializePluginPageWhenReady() {
|
||||
if (target.id === 'plugins-content' ||
|
||||
target.querySelector('#installed-plugins-grid')) {
|
||||
console.log('HTMX swap detected for plugins, initializing...');
|
||||
// Reset initialization flag to allow re-initialization after HTMX swap
|
||||
// Reset all initialization flags so the fresh empty DOM gets populated
|
||||
window.pluginManager.initialized = false;
|
||||
window.pluginManager.initializing = false;
|
||||
window.pluginManager._reswap = true; // signal: use cached store, don't re-fetch GitHub
|
||||
pluginsInitialized = false;
|
||||
initTimer = setTimeout(attemptInit, 100);
|
||||
}
|
||||
}, { once: false }); // Allow multiple swaps
|
||||
@@ -1211,9 +1213,13 @@ function initializePlugins() {
|
||||
console.warn('[INIT] checkGitHubAuthStatus not available yet');
|
||||
}
|
||||
|
||||
// Load both installed plugins and plugin store
|
||||
// Load both installed plugins and plugin store.
|
||||
// On HTMX re-swaps use cached store data (fetchCommitInfo=false) to avoid
|
||||
// re-hitting GitHub on every tab switch; only fetch fresh on first load.
|
||||
const isReswap = !!window.pluginManager._reswap;
|
||||
window.pluginManager._reswap = false;
|
||||
loadInstalledPlugins();
|
||||
searchPluginStore(true); // Load plugin store with fresh metadata from GitHub
|
||||
searchPluginStore(!isReswap);
|
||||
|
||||
// Setup search functionality (with guard against duplicate listeners)
|
||||
const searchInput = document.getElementById('plugin-search');
|
||||
@@ -5127,7 +5133,7 @@ function refreshPlugins() {
|
||||
pluginStoreCache = null;
|
||||
cacheTimestamp = null;
|
||||
|
||||
loadInstalledPlugins();
|
||||
refreshInstalledPlugins(); // invalidates cache before fetching
|
||||
// Fetch latest metadata from GitHub when refreshing
|
||||
searchPluginStore(true);
|
||||
showNotification('Plugins refreshed with latest metadata from GitHub', 'success');
|
||||
|
||||
Reference in New Issue
Block a user