mirror of
https://github.com/smittix/intercept.git
synced 2026-07-28 02:28:11 -07:00
Keep Morse panels visible and persist startup error diagnostics
This commit is contained in:
+10
-11
@@ -8,7 +8,7 @@ var MorseMode = (function () {
|
|||||||
var SETTINGS_KEY = 'intercept.morse.settings.v3';
|
var SETTINGS_KEY = 'intercept.morse.settings.v3';
|
||||||
var STATUS_POLL_MS = 5000;
|
var STATUS_POLL_MS = 5000;
|
||||||
var LOCAL_STOP_TIMEOUT_MS = 2200;
|
var LOCAL_STOP_TIMEOUT_MS = 2200;
|
||||||
var START_TIMEOUT_MS = 4000;
|
var START_TIMEOUT_MS = 10000;
|
||||||
|
|
||||||
var state = {
|
var state = {
|
||||||
initialized: false,
|
initialized: false,
|
||||||
@@ -281,6 +281,7 @@ var MorseMode = (function () {
|
|||||||
clearDiagLog();
|
clearDiagLog();
|
||||||
clearDecodedText();
|
clearDecodedText();
|
||||||
clearRawText();
|
clearRawText();
|
||||||
|
appendDiagLine('[start] requesting decoder startup...');
|
||||||
|
|
||||||
var payload = collectConfig();
|
var payload = collectConfig();
|
||||||
persistSettings();
|
persistSettings();
|
||||||
@@ -310,6 +311,7 @@ var MorseMode = (function () {
|
|||||||
startScope();
|
startScope();
|
||||||
setStatusText('Listening');
|
setStatusText('Listening');
|
||||||
applyMetrics(data.config || {}, true);
|
applyMetrics(data.config || {}, true);
|
||||||
|
appendDiagLine('[start] decoder started');
|
||||||
notifyInfo('Morse decoder started');
|
notifyInfo('Morse decoder started');
|
||||||
return data;
|
return data;
|
||||||
})
|
})
|
||||||
@@ -318,14 +320,11 @@ var MorseMode = (function () {
|
|||||||
return { status: 'stale' };
|
return { status: 'stale' };
|
||||||
}
|
}
|
||||||
setLifecycle('error');
|
setLifecycle('error');
|
||||||
setStatusText('Error');
|
var errorMsg = String(err && err.message ? err.message : err);
|
||||||
notifyError('Failed to start Morse decoder: ' + (err && err.message ? err.message : err));
|
setStatusText('Start failed');
|
||||||
setTimeout(function () {
|
appendDiagLine('[start] failed: ' + errorMsg);
|
||||||
if (state.lifecycle === 'error') {
|
notifyError('Failed to start Morse decoder: ' + errorMsg);
|
||||||
setLifecycle('idle');
|
return { status: 'error', message: errorMsg };
|
||||||
}
|
|
||||||
}, 800);
|
|
||||||
return { status: 'error', message: String(err && err.message ? err.message : err) };
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,10 +916,10 @@ var MorseMode = (function () {
|
|||||||
if (state.lifecycle === 'error') setStatusText('Error');
|
if (state.lifecycle === 'error') setStatusText('Error');
|
||||||
|
|
||||||
var scopePanel = el('morseScopePanel');
|
var scopePanel = el('morseScopePanel');
|
||||||
if (scopePanel) scopePanel.style.display = (running || starting) ? 'block' : 'none';
|
if (scopePanel) scopePanel.style.display = 'block';
|
||||||
|
|
||||||
var outputPanel = el('morseOutputPanel');
|
var outputPanel = el('morseOutputPanel');
|
||||||
if (outputPanel) outputPanel.style.display = (running || starting) ? 'block' : 'none';
|
if (outputPanel) outputPanel.style.display = 'block';
|
||||||
|
|
||||||
var scopeStatus = el('morseScopeStatusLabel');
|
var scopeStatus = el('morseScopeStatusLabel');
|
||||||
if (scopeStatus) {
|
if (scopeStatus) {
|
||||||
|
|||||||
Reference in New Issue
Block a user