mirror of
https://github.com/smittix/intercept.git
synced 2026-06-08 22:21:55 -07:00
Fix updater settings panel error when updater.js is blocked
Add defensive typeof checks before referencing the Updater global in loadUpdateStatus() and checkForUpdatesManual() so the settings panel shows a helpful message instead of crashing. Also swap script load order so updater.js loads before settings-manager.js. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -752,6 +752,11 @@ async function checkForUpdatesManual() {
|
||||
const content = document.getElementById('updateStatusContent');
|
||||
if (!content) return;
|
||||
|
||||
if (typeof Updater === 'undefined') {
|
||||
content.innerHTML = `<div style="color: var(--text-dim); padding: 10px;">Update checking is unavailable. If you use a content blocker, try allowing <code>updater.js</code> to load.</div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
content.innerHTML = '<div style="text-align: center; padding: 20px; color: var(--text-dim);">Checking for updates...</div>';
|
||||
|
||||
try {
|
||||
@@ -769,6 +774,11 @@ async function loadUpdateStatus() {
|
||||
const content = document.getElementById('updateStatusContent');
|
||||
if (!content) return;
|
||||
|
||||
if (typeof Updater === 'undefined') {
|
||||
content.innerHTML = `<div style="color: var(--text-dim); padding: 10px;">Update checking is unavailable. If you use a content blocker, try allowing <code>updater.js</code> to load.</div>`;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const data = await Updater.getStatus();
|
||||
renderUpdateStatus(data);
|
||||
|
||||
@@ -13925,10 +13925,10 @@
|
||||
<!-- Toast Container -->
|
||||
<div id="toastContainer"></div>
|
||||
|
||||
<!-- Settings Manager -->
|
||||
<script src="{{ url_for('static', filename='js/core/settings-manager.js') }}"></script>
|
||||
<!-- Updater -->
|
||||
<script src="{{ url_for('static', filename='js/core/updater.js') }}"></script>
|
||||
<!-- Settings Manager -->
|
||||
<script src="{{ url_for('static', filename='js/core/settings-manager.js') }}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user