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.
This commit is contained in:
parent
11aa52687c
commit
04cf2277d9
@ -2,7 +2,7 @@
|
|||||||
root: true
|
root: true
|
||||||
|
|
||||||
parserOptions:
|
parserOptions:
|
||||||
ecmaVersion: 2018
|
ecmaVersion: 2020
|
||||||
|
|
||||||
env:
|
env:
|
||||||
es6: true
|
es6: true
|
||||||
|
@ -6,7 +6,7 @@ import socket from "../socket";
|
|||||||
import store from "../store";
|
import store from "../store";
|
||||||
|
|
||||||
socket.on("more", function (data) {
|
socket.on("more", function (data) {
|
||||||
const channel = store.getters.findChannel(data.chan).channel;
|
const channel = store.getters.findChannel(data.chan)?.channel;
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user