diff --git a/client/js/commands/collapse.ts b/client/js/commands/collapse.ts index 2d74a8f5..953ba98b 100644 --- a/client/js/commands/collapse.ts +++ b/client/js/commands/collapse.ts @@ -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; diff --git a/client/js/commands/expand.ts b/client/js/commands/expand.ts index 791319a1..36290359 100644 --- a/client/js/commands/expand.ts +++ b/client/js/commands/expand.ts @@ -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;