When the Dashboard first loaded, it would take a really long time to fetch for the thumbnails (and most of the time it would time out).
Implementation:
loadThumbnailsForPage: This loads and displays thumbnails for sessions on the current page. It calculates the start and end indices based on currentPage and pageSize, clears the existing thumbnailsMap, and asynchronously fetches thumbnails for each session. This function will make the request to getThumbnails only 5 times per page (i.e. pageSize)
sessionsWithThumbnails: Updated to filter and return sessions for the current page that have associated thumbnail urls. Aka only sessions with available thumbnails are displayed
Added a watcher for filteredSessions because when the component first mounts it's an empty array and that would not trigger the cascade of loadThumbnailsForPage --> getThumbnails
Two other small fixes
The url to fetch pending requests was missing an & in the obsPortalData store
When the user would log in, the log in button would stay until the user refreshed the site. That has been fixed by making the username a computed property in App
VISUALS
User logs in, username is on the right (rather than log in button) and thumbnails load quickly. This is also after clearing my cache so it's reliable!
FEATURE: Pagination for faster thumbnail loading
Background:
When the Dashboard first loaded, it would take a really long time to fetch for the thumbnails (and most of the time it would time out).
Implementation:
loadThumbnailsForPage
: This loads and displays thumbnails for sessions on the current page. It calculates the start and end indices based oncurrentPage
andpageSize
, clears the existingthumbnailsMap
, and asynchronously fetches thumbnails for each session. This function will make the request togetThumbnails
only 5 times per page (i.e.pageSize
)sessionsWithThumbnails
: Updated to filter and return sessions for the current page that have associated thumbnail urls. Aka only sessions with available thumbnails are displayedfilteredSessions
because when the component first mounts it's an empty array and that would not trigger the cascade ofloadThumbnailsForPage
-->getThumbnails
Two other small fixes
&
in theobsPortalData
storeApp
VISUALS
User logs in, username is on the right (rather than
log in
button) and thumbnails load quickly. This is also after clearing my cache so it's reliable!https://github.com/user-attachments/assets/5ef31a7c-dd9e-45c4-9d9d-e0fe5d7761f7