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

View file

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