Skip to content

fix(web): blinking text on page (re)load #1592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/template/home.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@
</template>
</article>
</template>
<template x-if="!hasLivestreams() && !recently.hasElements() && userCourses.length == 0 && liveToday.length == 0 && !hasLivestreams()">
<template x-if="loaded && !hasLivestreams() && !recently.hasElements() && userCourses.length == 0 && liveToday.length == 0">
<span class="font-semibold m-auto dark:text-white">
No streams, VODs or courses to show in this semester.
</span>
Expand Down
3 changes: 3 additions & 0 deletions web/ts/components/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export function mainContext(year: number, term: string) {
liveToday: [] as Course[],
recently: new AutoPaginator<Course>([], 10, (c: Course) => c.LastRecording.FetchThumbnail()),

loaded: false,

/**
* AlpineJS init function which is called automatically in addition to 'x-init'
*/
Expand Down Expand Up @@ -52,6 +54,7 @@ export function mainContext(year: number, term: string) {
this.recently.reset().preload();
})
.finally(() => {
this.loaded = true;
console.log("🌑 init recently", this.recently);
console.log("🌑 init live today", this.liveToday);
});
Expand Down
Loading