Browse Source

Prevent possible error when findChannel can't find the wanted channel

Using ?. (optional chaining) requires ecma version 2020 as it is fairly new. Webpack / Babel can handle it.
pull/4206/head
Nachtalb 2 months ago
parent
commit
04cf2277d9
No known key found for this signature in database GPG Key ID: E48DF13C07055D92
  1. 2
      .eslintrc.yml
  2. 2
      client/js/socket-events/more.js

2
.eslintrc.yml

@ -2,7 +2,7 @@
root: true
parserOptions:
ecmaVersion: 2018
ecmaVersion: 2020
env:
es6: true

2
client/js/socket-events/more.js

@ -6,7 +6,7 @@ import socket from "../socket";
import store from "../store";
socket.on("more", function (data) {
const channel = store.getters.findChannel(data.chan).channel;
const channel = store.getters.findChannel(data.chan)?.channel;
if (!channel) {
return;

Loading…
Cancel
Save