Fix removing networks

This commit is contained in:
Pavel Djundik 2019-11-02 21:06:34 +02:00
parent c8b22b2df3
commit c4d6afe3d6
2 changed files with 14 additions and 12 deletions

View File

@ -46,22 +46,11 @@ export default {
},
methods: {
close() {
let cmd = "/close";
if (this.channel.type === "lobby") {
cmd = "/quit";
// eslint-disable-next-line no-alert
if (!confirm(`Are you sure you want to remove ${this.channel.name}?`)) {
return false;
}
}
this.closed = true;
socket.emit("input", {
target: Number(this.channel.id),
text: cmd,
text: "/close",
});
},
getAriaLabel() {

View File

@ -42,11 +42,13 @@
@click.stop="$emit('toggleJoinChannel')"
/>
</span>
<button class="close" hidden @click="close" />
</ChannelWrapper>
</template>
<script>
import ChannelWrapper from "./ChannelWrapper.vue";
import socket from "../js/socket";
const storage = require("../js/localStorage");
export default {
@ -68,6 +70,17 @@ export default {
},
},
methods: {
close() {
// eslint-disable-next-line no-alert
if (!confirm(`Are you sure you want to remove ${this.channel.name}?`)) {
return false;
}
socket.emit("input", {
target: Number(this.channel.id),
text: "/quit",
});
},
onCollapseClick() {
const networks = new Set(JSON.parse(storage.get("thelounge.networks.collapsed")));
this.network.isCollapsed = !this.network.isCollapsed;