style: 🎨 Run Biome

This commit is contained in:
Jesse Wierzbinski 2024-04-26 21:58:17 -10:00
parent 83ff97d7ff
commit 7461478170
No known key found for this signature in database
2 changed files with 25 additions and 19 deletions

View file

@ -114,18 +114,18 @@ const mentions = await useResolveMentions(
); );
const eventualReblogAccountName = props.note?.reblog const eventualReblogAccountName = props.note?.reblog
? useParsedContent( ? useParsedContent(
props.note?.account.display_name, props.note?.account.display_name,
props.note?.account.emojis, props.note?.account.emojis,
mentions.value, mentions.value,
).value ).value
: null; : null;
const content = const content =
note.value && process.client note.value && process.client
? useParsedContent( ? useParsedContent(
note.value.content, note.value.content,
note.value.emojis, note.value.emojis,
mentions.value, mentions.value,
) )
: ""; : "";
const numberFormat = (number = 0) => const numberFormat = (number = 0) =>
new Intl.NumberFormat(undefined, { new Intl.NumberFormat(undefined, {
@ -141,7 +141,7 @@ const deleteNote = async () => {
if (result?.data) { if (result?.data) {
console.log("Status deleted", result.data); console.log("Status deleted", result.data);
emits('delete') emits("delete");
} }
}; };
</script> </script>

View file

@ -17,7 +17,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { Status } from '~/types/mastodon/status'; import type { Status } from "~/types/mastodon/status";
const props = defineProps<{ const props = defineProps<{
timeline: Status[]; timeline: Status[];
@ -52,13 +52,19 @@ useIntervalFn(() => {
props.loadPrev(); props.loadPrev();
}, 5000); }, 5000);
watch(() => props.timeline, (newTimeline, oldTimeline) => { watch(
// If posts are deleted, don't start loading more posts () => props.timeline,
if (newTimeline.length === oldTimeline.length - 1) return; (newTimeline, oldTimeline) => {
isLoading.value = false; // If posts are deleted, don't start loading more posts
// If less than NOTES_PER_PAGE statuses are returned, we have reached the end if (newTimeline.length === oldTimeline.length - 1) return;
if (newTimeline.length - oldTimeline.length < useConfig().NOTES_PER_PAGE) { isLoading.value = false;
hasReachedEnd.value = true; // If less than NOTES_PER_PAGE statuses are returned, we have reached the end
} if (
}); newTimeline.length - oldTimeline.length <
useConfig().NOTES_PER_PAGE
) {
hasReachedEnd.value = true;
}
},
);
</script> </script>