diff --git a/client/components/Windows/Changelog.vue b/client/components/Windows/Changelog.vue
index 6177d9a5..ae30e05a 100644
--- a/client/components/Windows/Changelog.vue
+++ b/client/components/Windows/Changelog.vue
@@ -4,7 +4,7 @@
- « Help
+ « Help
v{{ $root.serverConfiguration.version }} (release notes)
diff --git a/client/components/Windows/NetworkEdit.vue b/client/components/Windows/NetworkEdit.vue
index 2a8a9fd0..20e97706 100644
--- a/client/components/Windows/NetworkEdit.vue
+++ b/client/components/Windows/NetworkEdit.vue
@@ -1,8 +1,8 @@
@@ -21,9 +21,21 @@ export default {
data() {
return {
disabled: false,
+ networkData: null,
};
},
+ watch: {
+ "$route.params.uuid"() {
+ this.setNetworkData();
+ },
+ },
+ mounted() {
+ this.setNetworkData();
+ },
methods: {
+ setNetworkData() {
+ this.networkData = this.$root.findNetwork(this.$route.params.uuid);
+ },
handleSubmit(data) {
this.disabled = true;
socket.emit("network:edit", data);
@@ -32,7 +44,6 @@ export default {
// TODO: move networks to vuex and update state when the network info comes in
const network = this.$root.networks.find((n) => n.uuid === data.uuid);
network.name = network.channels[0].name = data.name;
-
sidebar.find(`.network[data-uuid="${data.uuid}"] .chan.lobby .name`).click();
},
},
diff --git a/client/js/contextMenuFactory.js b/client/js/contextMenuFactory.js
index cd39f7c0..46f53ea2 100644
--- a/client/js/contextMenuFactory.js
+++ b/client/js/contextMenuFactory.js
@@ -290,8 +290,8 @@ function addFocusItem() {
}
function addEditNetworkItem() {
- function edit(itemData) {
- socket.emit("network:get", itemData);
+ function edit(networkUuid) {
+ vueApp.$router.push("/edit-network/" + networkUuid);
}
addContextMenuItem({
diff --git a/client/js/router.js b/client/js/router.js
index 9d7faeff..0e4e9df6 100644
--- a/client/js/router.js
+++ b/client/js/router.js
@@ -9,6 +9,7 @@ const Connect = require("../components/Windows/Connect.vue").default;
const Settings = require("../components/Windows/Settings.vue").default;
const Help = require("../components/Windows/Help.vue").default;
const Changelog = require("../components/Windows/Changelog.vue").default;
+const NetworkEdit = require("../components/Windows/NetworkEdit.vue").default;
const RoutedChat = require("../components/RoutedChat.vue").default;
const router = new VueRouter({
@@ -53,6 +54,14 @@ const router = new VueRouter({
windowName: "Changelog",
},
},
+ {
+ path: "/edit-network/:uuid",
+ component: NetworkEdit,
+ meta: {
+ isChat: false,
+ windowName: "NetworkEdit",
+ },
+ },
{
path: "/chan-*",
component: RoutedChat,
diff --git a/client/js/vue.js b/client/js/vue.js
index ec862398..984a207a 100644
--- a/client/js/vue.js
+++ b/client/js/vue.js
@@ -102,12 +102,21 @@ const vueApp = new Vue({
return null;
},
+ findNetwork(uuid) {
+ for (const network of this.networks) {
+ if (network.uuid === uuid) {
+ return network;
+ }
+ }
+
+ return null;
+ },
switchToChannel(channel) {
if (this.activeChannel && this.activeChannel.channel.id === channel.id) {
return;
}
- this.$router.push("chan-" + channel.id);
+ this.$router.push("/chan-" + channel.id);
},
switchOutOfChannel(channel) {
// When switching out of a channel, mark everything as read