Compare commits

..

No commits in common. "8b820aef770e520acdc8216193c06867f5f47281" and "1c096df3956192a2bb35ee72fe3cd96ba6498d75" have entirely different histories.

2 changed files with 5 additions and 10 deletions

View File

@ -22,11 +22,8 @@ app.get('/ipad.png', async (req, res) => {
frontend_url.searchParams.set('tool', req.query.tool);
}
await puppet_page.goto(frontend_url.toString());
// TODO: handle timeout better (ie present a better error to the frontend)
await puppet_page.waitForSelector('#loadingSpinner', {
hidden: true,
timeout: 10,
});
// TODO: handle timeout
await puppet_page.waitForNetworkIdle({ timeout: 5000 });
const screenshot = await puppet_page.screenshot();
await puppet_page.close();
res.send(screenshot);

View File

@ -31,19 +31,17 @@ calendarImg.addEventListener('load', () => {
calendarImg.addEventListener('error', (event) => {
spinner.style.display = 'none';
console.error('Error fetching calendar image: ', event);
errorModal.style.display = '';
const message = errorModal.querySelector('.modal-message')!;
message.textContent = `Failed to fetch events. Displayed events may not be accurate.`;
message.textContent = `Failed to fetch events: ${event.message}. Displayed events may not be accurate.`;
});
function refresh() {
spinner.style.display = '';
const url = new URL('/ipad.png', window.location.href);
url.searchParams.set(
'viewport',
`${window.innerWidth}x${window.innerHeight}x${window.devicePixelRatio}`
);
url.searchParams.set('viewport', `${window.innerWidth}x${window.innerHeight}x${window.devicePixelRatio}`);
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('tool')) {