diff --git a/index.html b/index.html index e55250f..254e463 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - Threads + nymspace diff --git a/src/components/Shared/FooterSection.vue b/src/components/Shared/FooterSection.vue index 31e1c0d..aad1e10 100644 --- a/src/components/Shared/FooterSection.vue +++ b/src/components/Shared/FooterSection.vue @@ -8,8 +8,8 @@ target="_blank" class="text-xl self-center" > - Threads GitHub - Threads GitHub + nymspace GitHub + nymspace GitHub diff --git a/src/components/Shared/HeaderSection.vue b/src/components/Shared/HeaderSection.vue index 741adde..0ce413f 100644 --- a/src/components/Shared/HeaderSection.vue +++ b/src/components/Shared/HeaderSection.vue @@ -4,12 +4,7 @@ >
- Threads -

Threads

+

nymspace

About Threads + >About Nymity
diff --git a/src/views/MessagesPage.vue b/src/views/MessagesPage.vue index 50cab66..00c841a 100644 --- a/src/views/MessagesPage.vue +++ b/src/views/MessagesPage.vue @@ -242,6 +242,16 @@ const updatedMsgs = computed((x) => { /** * Send message via ws */ +function parseJwt (token) { + var base64Url = token.split('.')[1]; + var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); + var jsonPayload = decodeURIComponent(window.atob(base64).split('').map(function(c) { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + + return JSON.parse(jsonPayload); +} + async function sendMessage() { if (message.value.trim().length > 0 && !getActiveThread.value?.locked && !pseudonymMismatch.value) { try { @@ -419,15 +429,15 @@ const reconnectSockets = () =>{ } onMounted(async () => { - wsInstance.value = new SocketioService(); - wsInstance.value.addDisconnectHandler(reconnectSockets); - reconnectSockets(); - const user = await loadUser(); goodReputation.value = user.goodReputation; await fetchMessages(route.params.threadId); await fetchThreadDetails(route.params.threadId); messageTextArea.value?.focus(); + + wsInstance.value = new SocketioService(); + wsInstance.value.addDisconnectHandler(reconnectSockets); + reconnectSockets(); }); onUnmounted(() => { diff --git a/src/views/ThreadsPage.vue b/src/views/ThreadsPage.vue index 85d612d..809dafc 100644 --- a/src/views/ThreadsPage.vue +++ b/src/views/ThreadsPage.vue @@ -176,10 +176,6 @@ const reconnectSockets = () =>{ } onMounted(async () => { - wsInstance.value = new SocketioService(); - wsInstance.value.addDisconnectHandler(reconnectSockets); - reconnectSockets(); - await loadUserThreads(); await loadThreads(route.params.channelId); @@ -189,6 +185,10 @@ onMounted(async () => { channel.value = getChannel(route.params.channelId); } + wsInstance.value = new SocketioService(); + wsInstance.value.addDisconnectHandler(reconnectSockets); + reconnectSockets(); + setActiveChannel(channel.value); });