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

@ -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(
() => props.timeline,
(newTimeline, oldTimeline) => {
// If posts are deleted, don't start loading more posts // If posts are deleted, don't start loading more posts
if (newTimeline.length === oldTimeline.length - 1) return; if (newTimeline.length === oldTimeline.length - 1) return;
isLoading.value = false; isLoading.value = false;
// If less than NOTES_PER_PAGE statuses are returned, we have reached the end // If less than NOTES_PER_PAGE statuses are returned, we have reached the end
if (newTimeline.length - oldTimeline.length < useConfig().NOTES_PER_PAGE) { if (
newTimeline.length - oldTimeline.length <
useConfig().NOTES_PER_PAGE
) {
hasReachedEnd.value = true; hasReachedEnd.value = true;
} }
}); },
);
</script> </script>