Open
Description
When the fetch for the Room Availability feature fails, the error is not caught and reported accordingly resulting in a stream of extension/console errors. I believe this can be fixed by using a .catch
before .then
in FreeRooms:getAvailableRooms
.
Also I think a lot of the code can be written more nicely with the new jQuery style syntax through Cash. For example, the following:
stevens-web-extension/src/features/FreeRooms/FreeRooms.ts
Lines 123 to 135 in 3f4fc5c
can be simplified to:
$(td).each((i, x) => {
// The reason why we need to do $(x) is because x is an HTMLElement, which can only
// be manipulated with native JavaScript (i.e. x.hasAttr('colspan'), x.innerHTML)
let colspan = $(x).attr('colspan');
if (colspan) {
totalColspan += parseInt(colspan);
if (totalColspan >= colspanTime) {
if ($(x).html() === '') {
flag = true;
} else {
break;
}
}
}
})