previews: fix possibly undefined

This commit is contained in:
Reto Brunner 2024-04-21 15:09:11 +02:00
parent 96848c1c1b
commit f25fee4c6c
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ function input() {
for (const message of store.state.activeChannel.channel.messages) {
let toggled = false;
for (const preview of message.previews) {
for (const preview of message.previews || []) {
if (preview.shown) {
preview.shown = false;
toggled = true;

View file

@ -11,7 +11,7 @@ function input() {
for (const message of store.state.activeChannel.channel.messages) {
let toggled = false;
for (const preview of message.previews) {
for (const preview of message.previews || []) {
if (!preview.shown) {
preview.shown = true;
toggled = true;