extraInfo: increment thread timeout from 15s to 30s
15 seconds was too little time for longer threads which take a lot of
time to render after the response is retrieved (e.g.
https://support.google.com/s/community/forum/659278/thread/109470335).
30s is a good time interval when loading all the messages at once.
Bug: twpowertools:93
Change-Id: I7c82f26e95b0ba4d7f924abbec48bf8e735bce38
diff --git a/src/contentScripts/communityConsole/extraInfo.js b/src/contentScripts/communityConsole/extraInfo.js
index 88a68be..b409b13 100644
--- a/src/contentScripts/communityConsole/extraInfo.js
+++ b/src/contentScripts/communityConsole/extraInfo.js
@@ -483,14 +483,14 @@
waitFor(() => {
let now = Date.now();
let threadInfo = this.lastThread.body['1']?.['2']?.['1'];
- if (now - this.lastThread.timestamp < 15 * 1000 &&
+ if (now - this.lastThread.timestamp < 30 * 1000 &&
threadInfo?.['1'] == currentPage.thread &&
threadInfo?.['3'] == currentPage.forum)
return Promise.resolve(this.lastThread);
return Promise.reject(new Error('Didn\'t receive thread information'));
}, {
interval: 500,
- timeout: 15 * 1000,
+ timeout: 30 * 1000,
}).then(thread => {
let info = [];
@@ -618,7 +618,7 @@
waitFor(() => {
let now = Date.now();
let threadInfo = this.lastThread.body['1']?.['2']?.['1'];
- if (now - this.lastThread.timestamp < 15 * 1000 &&
+ if (now - this.lastThread.timestamp < 30 * 1000 &&
threadInfo?.['1'] == currentPage.thread &&
threadInfo?.['3'] == currentPage.forum) {
const message =
@@ -631,7 +631,7 @@
', index: ' + index + ')'));
}, {
interval: 1000,
- timeout: 15 * 1000,
+ timeout: 30 * 1000,
}).then(message => {
let info = [];