Skip to content

Commit

Permalink
fix footer crash (#594)
Browse files Browse the repository at this point in the history
* fix footer crash
  • Loading branch information
cp-isha-p authored Nov 20, 2024
1 parent ded8013 commit 911bb04
Show file tree
Hide file tree
Showing 2 changed files with 1,584 additions and 1,822 deletions.
19 changes: 18 additions & 1 deletion nuxt-frontend/pages/tag/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,30 @@ const posts = ref([]);
const store = useTagListStore();
const resources = computed(() => store.items);
const status = computed(() => store.status);
let postLimit = 2;
let postLimit;
const setPostLimit = () => {
if (process.client) {
if (window.innerWidth > 1920 && window.innerHeight > 1080) {
postLimit = 7;
} else if (window.innerWidth > 1440 && window.innerHeight > 900) {
postLimit = 4;
} else if (window.innerWidth > 1024 && window.innerHeight > 768) {
postLimit = 3;
} else if (window.innerWidth <= 1024) {
postLimit = 2;
} else {
postLimit = 2;
}
}
};
await useAsyncData("tags", () =>
store.loadTagBlogs(config.SHOW_DRAFT_POSTS, slug.value),
);
if (status.value === config.SUCCESS) {
setPostLimit();
posts.value = resources.value?.slice(0, postLimit);
}
Expand Down
Loading

0 comments on commit 911bb04

Please sign in to comment.