Find channel in joinchannel correctly

This commit is contained in:
Pavel Djundik 2018-07-23 12:14:35 +03:00 committed by Pavel Djundik
parent a21e0e34cd
commit 2c5549a567
2 changed files with 4 additions and 2 deletions

View File

@ -50,6 +50,7 @@ export default {
}, },
}, },
props: { props: {
network: Object,
channel: Object, channel: Object,
}, },
data() { data() {
@ -60,8 +61,8 @@ export default {
}, },
methods: { methods: {
onSubmit() { onSubmit() {
const utils = require("../js/utils"); const channelToFind = this.inputChannel.toLowerCase();
const existingChannel = utils.findCurrentNetworkChan(this.inputChannel); const existingChannel = this.network.channels.find((c) => c.name.toLowerCase() === channelToFind);
if (existingChannel) { if (existingChannel) {
const $ = require("jquery"); const $ = require("jquery");

View File

@ -35,6 +35,7 @@
/> />
<JoinChannel <JoinChannel
v-if="network.isJoinChannelShown" v-if="network.isJoinChannelShown"
:network="network"
:channel="network.channels[0]" :channel="network.channels[0]"
@toggleJoinChannel="network.isJoinChannelShown = !network.isJoinChannelShown" @toggleJoinChannel="network.isJoinChannelShown = !network.isJoinChannelShown"
/> />