Skip to content

Commit 3e0f425

Browse files
pageToolbar: increase page detail request timeout
1 parent cb639dc commit 3e0f425

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/session/DeputyPageSession.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ export default class DeputyPageSession {
1818
* this value should be set to null. This ensures that a generic toolbar is
1919
* used instead of the revision-specific toolbar.
2020
* @param title The title of the page to get information for. Defaults to current.
21+
* @param timeout Timeout for the page detail request.
2122
*/
2223
static async getPageDetails(
2324
revision?: number,
24-
title: mw.Title = window.deputy.currentPage
25+
title: mw.Title = window.deputy.currentPage,
26+
timeout = 500
2527
): Promise<DeputyPageStatusResponseMessage | null> {
2628
return window.deputy.comms.sendAndWait( {
2729
type: 'pageStatusRequest',
2830
page: title.getPrefixedText(),
2931
revision: revision
30-
} );
32+
}, timeout );
3133
}
3234

3335
/**
@@ -83,7 +85,10 @@ export default class DeputyPageSession {
8385
mw.config.get( 'wgDiffOldId' ) :
8486
// On a "prev" diff page
8587
mw.config.get( 'wgDiffNewId' ) ) ||
86-
mw.config.get( 'wgRevisionId' )
88+
mw.config.get( 'wgRevisionId' ),
89+
window.deputy.currentPage,
90+
// Relatively low-stakes branch, we can handle a bit of a delay.
91+
2000
8792
);
8893

8994
const openPromise = this.appendToolbar( {

0 commit comments

Comments
 (0)