1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-03 03:44:31 +02:00
Files
misskey/packages/frontend/src/pages/chat/home.joiningRooms.vue
syuilo 8959bfa1c0 refactor(frontend): 空/エラー結果表示をコンポーネント化 (#15963)
* wip

* wip

* wip

* wip

* wip

* Update MkResult.vue

* Add storybook story for MkResult (#15964)

* Update MkResult.vue

---------

Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com>
2025-05-06 14:41:31 +09:00

44 lines
1004 B
Vue

<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div class="_gaps">
<div v-if="memberships.length > 0" class="_gaps_s">
<XRoom v-for="membership in memberships" :key="membership.id" :room="membership.room!"/>
</div>
<MkResult v-if="!fetching && memberships.length == 0" type="empty" :text="i18n.ts._chat.noRooms"/>
<MkLoading v-if="fetching"/>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
import XRoom from './XRoom.vue';
import { i18n } from '@/i18n.js';
import { misskeyApi } from '@/utility/misskey-api.js';
const fetching = ref(true);
const memberships = ref<Misskey.entities.ChatRoomMembership[]>([]);
async function fetchRooms() {
fetching.value = true;
const res = await misskeyApi('chat/rooms/joining');
memberships.value = res;
fetching.value = false;
}
onMounted(() => {
fetchRooms();
});
</script>
<style lang="scss" module>
</style>