From 2d5e7f745f54da7917ad6768d3e9b58fcadf3e69 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Tue, 1 Feb 2022 00:33:42 +0300 Subject: [PATCH] Skip non-ready state of player in nowPlayingBar When nowPlayingBar receives an `init` event, some propertes of `state` are not yet defined. Wait for `playbackstart`. --- src/components/nowPlayingBar/nowPlayingBar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/nowPlayingBar/nowPlayingBar.js b/src/components/nowPlayingBar/nowPlayingBar.js index daa2d3bf15..9b2d55c2f9 100644 --- a/src/components/nowPlayingBar/nowPlayingBar.js +++ b/src/components/nowPlayingBar/nowPlayingBar.js @@ -658,6 +658,11 @@ import { appRouter } from '../appRouter'; } function onStateChanged(event, state) { + if (event.type === 'init') { + // skip non-ready state + return; + } + console.debug('nowplaying event: ' + event.type); const player = this;