Use JavaScript Optional chaining

This commit is contained in:
the-djmaze 2022-09-02 11:52:07 +02:00
parent d9bc435e2c
commit 732b6eb641
55 changed files with 169 additions and 199 deletions

View file

@ -4,7 +4,7 @@ import { addObservablesTo } from 'External/ko';
let notificator = null,
player = null,
canPlay = type => player && !!player.canPlayType(type).replace('no', ''),
canPlay = type => !!player?.canPlayType(type).replace('no', ''),
audioCtx = window.AudioContext || window.webkitAudioContext,
@ -92,7 +92,7 @@ export const SMAudio = new class {
}
pause() {
player && player.pause();
player?.pause();
fireEvent('audio.stop');
}