項目がない場合の表示を改善

This commit is contained in:
kakkokari-gtyih 2024-06-02 20:31:32 +09:00
parent d90f84d24f
commit b511821aaf
2 changed files with 12 additions and 2 deletions

View File

@ -7,6 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.noteEmbedRoot">
<MkLoading v-if="loading"/>
<MkNote v-else-if="note" :note="note"/>
<XNotFound v-else/>
</div>
</template>
@ -14,6 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { ref } from 'vue';
import * as Misskey from 'misskey-js';
import MkNote from '@/components/MkNote.vue';
import XNotFound from '@/pages/not-found.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';
const props = defineProps<{
@ -28,7 +30,10 @@ misskeyApi('notes/show', {
}).then(res => {
note.value = res;
loading.value = false;
});
}).catch(err => {
console.error(err);
loading.value = false;
})
</script>
<style lang="scss" module>

View File

@ -12,6 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkNotes :class="$style.userTimelineNotes" :pagination="pagination" :noGap="true"/>
</template>
<XNotFound v-else/>
</div>
</template>
@ -19,6 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { ref, computed } from 'vue';
import * as Misskey from 'misskey-js';
import MkNotes from '@/components/MkNotes.vue';
import XNotFound from '@/pages/not-found.vue';
import type { Paging } from '@/components/MkPagination.vue';
import { misskeyApi } from '@/scripts/misskey-api.js';
@ -43,7 +45,10 @@ misskeyApi('users/show', {
}).then(res => {
user.value = res;
loading.value = false;
});
}).catch(err => {
console.error(err);
loading.value = false;
})
</script>
<style lang="scss" module>