fix(pwa): handle orientation.lock() promise rejection silently

screen.orientation.lock() returns a Promise; the old try/catch only
caught synchronous errors, leaving the rejection unhandled and triggering
the auto-reporter (issue #8). Added .catch(()=>{}) to suppress it.
Also fixed CI: add sleep+retry around gh release create to avoid 502
race condition after delete.

Closes #8
This commit is contained in:
dadaloop82
2026-05-04 15:46:17 +00:00
parent 3649be848a
commit e68d11a7fc
2 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -10147,7 +10147,7 @@ function startCookingMode() {
document.getElementById('cooking-tts-btn').textContent = '🔊';
document.getElementById('cooking-overlay').style.display = 'flex';
document.body.classList.add('cooking-mode-active');
try { screen.orientation?.lock('portrait'); } catch (_) { /* ignore */ }
try { screen.orientation?.lock('portrait').catch(() => {}); } catch (_) { /* ignore */ }
renderCookingStep();
if (_cookingTTS) {
const text = ((_cookingRecipe.steps || [])[_cookingStep] || '').replace(/^Passo\s*\d+\s*[:.]\s*/i, '');
@@ -10159,7 +10159,7 @@ function closeCookingMode() {
document.body.classList.remove('cooking-mode-active');
// NOTE: intentionally keep _cookingRecipe, _cookingStep, _cookingVisited
// so the user can resume from the same step when they reopen
try { screen.orientation?.unlock(); } catch (_) { /* ignore */ }
try { screen.orientation?.unlock().catch(() => {}); } catch (_) { /* ignore */ }
}
function restartCookingMode() {