small frontend rewrite

This commit is contained in:
Zoe
2023-04-24 20:12:36 -05:00
parent 4890d657b5
commit 5743ae664e
40 changed files with 2630 additions and 2569 deletions

7
pages/channel/@me/index.vue Executable file → Normal file
View File

@@ -6,7 +6,8 @@
</template>
<script lang="ts">
import { useGlobalStore } from '~/stores/store';
import { useActiveStore } from '~/stores/activeStore';
import { useDmStore } from '~/stores/dmStore';
import { IChannel } from '~/types';
definePageMeta({
@@ -20,14 +21,14 @@ export default {
};
},
mounted() {
useGlobalStore().setActiveServer('dms', '@me');
useActiveStore().type = 'dm';
},
methods: {
async startDM() {
const headers = useRequestHeaders(['cookie']) as Record<string, string>;
const server: IChannel = await $fetch('/api/channels/createDM', { method: 'post', body: { partnerId: this.userId }, headers });
useGlobalStore().addDM(server);
useDmStore().addDM(server);
useRouter().push({ path: '/channel/@me/' + server.id });
}
}