Asem75 commited on
Commit
dbbe81d
·
verified ·
1 Parent(s): a226b2e

Update islamic_radio.js

Browse files
Files changed (1) hide show
  1. islamic_radio.js +1 -0
islamic_radio.js CHANGED
@@ -140,6 +140,7 @@
140
  window.addEventListener('muslim-clock-audio-start', e => { if (e.detail?.source !== 'radio' && current) stop(); });
141
  window.addEventListener('muslim-native-radio', async e => {
142
  const s = e.detail?.state, name = e.detail?.name;
 
143
  if (s === 'idle' || s === 'stopped') { current = null; state = s; emit(); return; }
144
  try { const c = await config(); current = c.stations.find(x => x.name === name) || current || { id: 'native', name: name || '', category: 'other' }; } catch { /* keep current */ }
145
  state = ['loading', 'playing', 'paused', 'error'].includes(s) ? s : state; emit();
 
140
  window.addEventListener('muslim-clock-audio-start', e => { if (e.detail?.source !== 'radio' && current) stop(); });
141
  window.addEventListener('muslim-native-radio', async e => {
142
  const s = e.detail?.state, name = e.detail?.name;
143
+ if (String(s).startsWith('keepalive')) return; // the Quran keep-alive notification, not the radio
144
  if (s === 'idle' || s === 'stopped') { current = null; state = s; emit(); return; }
145
  try { const c = await config(); current = c.stations.find(x => x.name === name) || current || { id: 'native', name: name || '', category: 'other' }; } catch { /* keep current */ }
146
  state = ['loading', 'playing', 'paused', 'error'].includes(s) ? s : state; emit();