Skip to content

Commit

Permalink
Fix: open modal generating tile do not exist errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
FMaz008 committed Oct 9, 2024
1 parent 8b25dbf commit 306910e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions scripts/bootloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ window.addEventListener("message", async function (event) {
if (tile) {
tile.getToolbar().setETV(event.data.data.etv, event.data.data.etv, true);
} else {
console.error("Unable to find the tile for ASIN " + tileASIN);
//This can happen when we force an open modal for an item that is not present on the page
//console.error("Unable to find the tile for ASIN " + tileASIN);
}

//Show a notification
Expand Down Expand Up @@ -915,7 +916,12 @@ window.addEventListener("message", async function (event) {

//Update the product tile ETV in the Toolbar
let tile = getTileByAsin(tileASIN);
tile.getToolbar().createOrderWidget(event.data.data.status == "success");
if (tile) {
tile.getToolbar().createOrderWidget(event.data.data.status == "success");
} else {
//This can happen when we force an open modal for an item that is not present on the page
//console.error("Unable to find the tile for ASIN " + tileASIN);
}
}

const note = new ScreenNotification();
Expand Down
2 changes: 1 addition & 1 deletion scripts/preboot.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function getSettings() {
if (vineQueue != null) vineQueueAbbr = arrQueues[vineQueue];

//Generate a UUID for the user
uuid = Settings.get("general.uuid");
uuid = Settings.get("general.uuid", false);
if (!uuid) {
uuid = await requestNewUUID();
Settings.set("general.uuid", uuid);
Expand Down

0 comments on commit 306910e

Please sign in to comment.