typing indicator, mentions + bug fixes

This commit is contained in:
Zoe
2023-01-14 06:37:13 -06:00
parent c39da0678d
commit f1c5537697
23 changed files with 629 additions and 190 deletions

View File

@@ -48,7 +48,7 @@ export default {
},
methods: {
async signup() {
const headers = useRequestHeaders(['cookie']) as Record<string, string>
const globalStore = useGlobalStore();
if (!this.username || !this.password || !this.email) return;
const user = await $fetch('/api/signup', {
method: 'post', body: {
@@ -56,7 +56,6 @@ export default {
email: this.email,
password: this.password
},
headers
}) as { userId: string; token: string; user: SafeUser; }
const userId = useCookie('userId')
@@ -64,6 +63,12 @@ export default {
const token = useCookie('sessionToken')
token.value = user.token
const headers = { Cookie: `sessionToken=${token.value}`}
const { servers, dms } = await $fetch('/api/user/getServers', { headers })
globalStore.setServers(servers)
globalStore.setDms(dms)
useGlobalStore().setUser(user.user)
navigateTo('/channel/@me')