don't explode when we watch a null game

This commit is contained in:
Branden J Brown 2024-02-02 19:34:38 -06:00
parent 8bd7532160
commit 0221c7d15d
1 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,9 @@ const roundChips = computed(() => [
// TODO(zeph): this probably should just be handled by the server and sent in the dto // TODO(zeph): this probably should just be handled by the server and sent in the dto
const msg = ref<string>(''); const msg = ref<string>('');
watch(props.game, (now, was) => { watch(props.game, (now, was) => {
if (now == null) {
return;
}
if (now.live != null && was?.live == null) { if (now.live != null && was?.live == null) {
msg.value = `THE SHOTGUN CONTAINS ${now.live} LIVE AND ${now.blank} BLANK SHELLS`; msg.value = `THE SHOTGUN CONTAINS ${now.live} LIVE AND ${now.blank} BLANK SHELLS`;
} else if (was == null) { } else if (was == null) {