File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -216,14 +216,14 @@ function setLocalStorage(key: string, value: string): void {
216216 try {
217217 localStorage . setItem ( key , value ) ;
218218 } catch ( error ) {
219- console . error ( error ) ;
219+ // Ignore the error since we can't fix it.
220220 }
221221}
222222function getLocalStorage ( key : string ) : string | null {
223223 try {
224224 return localStorage . getItem ( key ) ;
225225 } catch ( error ) {
226- console . error ( error ) ;
226+ // Ignore the error since we can't fix it.
227227 return null ;
228228 }
229229}
@@ -284,7 +284,8 @@ function onWindowResize(): void {
284284function animate ( ) : void {
285285 if ( synth . playing ) {
286286 animationRequest = requestAnimationFrame ( animate ) ;
287- if ( getLocalStorage ( "playerId" ) != id ) {
287+ const storedPlayerId : string | null = getLocalStorage ( "playerId" ) ;
288+ if ( storedPlayerId != null && storedPlayerId != id ) {
288289 onTogglePlay ( ) ;
289290 }
290291 renderPlayhead ( ) ;
You can’t perform that action at this time.
0 commit comments