Merge branch 'develop' into refactor/types

This commit is contained in:
naskya 2024-04-17 19:07:43 +09:00
commit adaaae1583
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 23 additions and 14 deletions

View file

@ -1,4 +1,4 @@
import { Entity } from "megalodon";
import type { Entity } from "megalodon";
import { toMastodonId } from "backend-rs";
function simpleConvert(data: any) {
@ -15,7 +15,19 @@ export function convertAnnouncement(announcement: Entity.Announcement) {
return simpleConvert(announcement);
}
export function convertAttachment(attachment: Entity.Attachment) {
return simpleConvert(attachment);
const converted = simpleConvert(attachment);
// ref: https://github.com/whitescent/Mastify/pull/102
if (converted.meta == null) return converted;
const result = {
...converted,
meta: {
...converted.meta,
original: {
...converted.meta,
},
},
};
return result;
}
export function convertFilter(filter: Entity.Filter) {
return simpleConvert(filter);

View file

@ -3,7 +3,7 @@
<template #header
><MkPageHeader :actions="headerActions" :tabs="headerTabs"
/></template>
<div ref="rootEl" class="eqqrhokj">
<MkSpacer>
<div class="tl _block">
<XTimeline
ref="tlEl"
@ -14,12 +14,15 @@
:sound="true"
/>
</div>
</div>
</MkSpacer>
</MkStickyContainer>
</template>
<script lang="ts" setup>
import { computed, ref, watch } from "vue";
import type { entities } from "firefish-js";
// TODO: disable this rule properly
// biome-ignore lint/style/useImportType: used in <template>
import XTimeline from "@/components/MkTimeline.vue";
import * as os from "@/os";
import { useRouter } from "@/router";
@ -33,9 +36,8 @@ const props = defineProps<{
listId: string;
}>();
const list = ref(null);
const list = ref<entities.UserList>();
const tlEl = ref<InstanceType<typeof XTimeline>>();
const rootEl = ref<HTMLElement>();
watch(
() => props.listId,
@ -92,13 +94,8 @@ definePageMetadata(
</script>
<style lang="scss" scoped>
.eqqrhokj {
padding: var(--margin);
max-width: 800px;
margin: 0 auto;
> .tl {
.tl {
background: none;
border-radius: var(--radius);
}
}
</style>