Re-render and focus the app only when it's rendered
This commit is contained in:
parent
812702097f
commit
42697ea9d2
1 changed files with 10 additions and 1 deletions
|
|
@ -139,6 +139,10 @@ export async function query(
|
|||
return promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} requestID The unique ID for the request
|
||||
* @param {string[]} users The user IDs that this rerequest should go to
|
||||
*/
|
||||
export async function requery(requestID, users) {
|
||||
const query = queries.get(requestID);
|
||||
if (!query) { return };
|
||||
|
|
@ -164,7 +168,12 @@ export async function requery(requestID, users) {
|
|||
for (const user of users) {
|
||||
query.status[user] = `waiting`;
|
||||
};
|
||||
query.app?.render({ parts: [ `users` ] });
|
||||
|
||||
// Rerender the status app
|
||||
if (query.app && query.app.rendered) {
|
||||
query.app.render({ parts: [ `users` ] });
|
||||
query.app.bringToFront();
|
||||
};
|
||||
};
|
||||
|
||||
export async function addResponse(requestID, userID, answers) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue