mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
feat(ui): render the page toast from the status store
ShellFeedback and the scene director show toasts through createToast(), each on its own timer as before, and the scene chrome renders the toast. Every show rewrites the text, so a repeated message is announced again.
This commit is contained in:
1 parent
3c391482f6
commit
f846aaed4c
13 files changed
+203
-43
No files matched your search
@@ -474,12 +474,22 @@ async function contacts() {
|
||||
|
||||
// SEARCH NEARBY SITES, as the user presses it.
|
||||
await page.evaluate(() => {
|
||||
document.getElementById('toast').textContent = '';
|
||||
const toast = document.getElementById('toast');
|
||||
const before = toast.firstChild;
|
||||
document.getElementById('installations-search-btn').click();
|
||||
window.__qaToastBefore = before;
|
||||
});
|
||||
// Every toast show writes a new text node, even for a repeated message.
|
||||
await page
|
||||
.waitForFunction(
|
||||
() => document.getElementById('toast').textContent.trim().length > 0,
|
||||
() => {
|
||||
const toast = document.getElementById('toast');
|
||||
return (
|
||||
toast.classList.contains('visible') &&
|
||||
toast.firstChild !== window.__qaToastBefore &&
|
||||
toast.textContent.trim().length > 0
|
||||
);
|
||||
},
|
||||
{ timeout: 20_000 },
|
||||
)
|
||||
.catch(() => {});
|
||||
|
||||
Reference in new issue
Block a user