Show error in box if one is available

Summary: Add a check to prevent the odd error when the box is no longer available to display an error.

Reviewed By: antonk52

Differential Revision: D46763634

fbshipit-source-id: 6ac2c404c842ff989b037c991b5f085baacd2f9a
This commit is contained in:
Lorenzo Blasa
2023-06-15 08:53:16 -07:00
committed by Facebook GitHub Bot
parent 8f20631f6a
commit 7fcaf52c71
2 changed files with 7 additions and 3 deletions

View File

@@ -81,8 +81,10 @@
}
const box = document.querySelector('.__infinity-dev-box-error');
box.removeAttribute('hidden');
box.textContent = text;
if (box) {
box.removeAttribute('hidden');
box.textContent = text;
}
}
// load correct theme (n.b. this doesn't handle system value specifically, will assume light in such cases)

View File

@@ -109,7 +109,9 @@
}
const box = document.getElementById('loading');
box.textContent = text;
if (box) {
box.textContent = text;
}
}
window.flipperShowError = openError;