diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-02-28 18:43:06 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-03-01 16:22:24 +0100 |
| commit | a229e8651d84da46ca4097948bfaa0a470565dd6 (patch) | |
| tree | 04e7f1f6dffd8b92444d4931a23177b54a11431e | |
| parent | 159b9b8ba2be61f9b4468257ac77bc870a8ddba0 (diff) | |
| download | mullvadvpn-a229e8651d84da46ca4097948bfaa0a470565dd6.tar.xz mullvadvpn-a229e8651d84da46ca4097948bfaa0a470565dd6.zip | |
Use global.setTimeout to disambiguate from window.setTimeout
| -rw-r--r-- | gui/src/main/index.ts | 4 | ||||
| -rw-r--r-- | gui/src/main/jsonrpc-client.ts | 2 | ||||
| -rw-r--r-- | gui/src/main/keyframe-animation.ts | 2 | ||||
| -rw-r--r-- | gui/src/renderer/app.tsx | 4 | ||||
| -rw-r--r-- | gui/src/renderer/components/ClipboardLabel.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/CustomScrollbars.tsx | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 860d847047..fb5f6efb54 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -560,7 +560,7 @@ class ApplicationMain { } }; - this.relaysInterval = setInterval(handler, RELAY_LIST_UPDATE_INTERVAL); + this.relaysInterval = global.setInterval(handler, RELAY_LIST_UPDATE_INTERVAL); } private stopRelaysPeriodicUpdates() { @@ -664,7 +664,7 @@ class ApplicationMain { const handler = () => { this.fetchLatestVersion(); }; - this.latestVersionInterval = setInterval(handler, VERSION_UPDATE_INTERVAL); + this.latestVersionInterval = global.setInterval(handler, VERSION_UPDATE_INTERVAL); } private stopLatestVersionPeriodicUpdates() { diff --git a/gui/src/main/jsonrpc-client.ts b/gui/src/main/jsonrpc-client.ts index 398cd075f7..67da72fab7 100644 --- a/gui/src/main/jsonrpc-client.ts +++ b/gui/src/main/jsonrpc-client.ts @@ -192,7 +192,7 @@ export default class JsonRpcClient<T> extends EventEmitter { const id = uuid.v4(); const payload = this.prepareParams(data); - const timerId = setTimeout(() => this.onTimeout(id), timeout); + const timerId = global.setTimeout(() => this.onTimeout(id), timeout); const message = jsonrpc.request(id, action, payload); this.unansweredRequests.set(id, { resolve, diff --git a/gui/src/main/keyframe-animation.ts b/gui/src/main/keyframe-animation.ts index 6e405c6ef7..25cd83a5db 100644 --- a/gui/src/main/keyframe-animation.ts +++ b/gui/src/main/keyframe-animation.ts @@ -83,7 +83,7 @@ export default class KeyframeAnimation { } private scheduleUpdate() { - this.timeout = setTimeout(() => this.onUpdateFrame(), this.speedValue); + this.timeout = global.setTimeout(() => this.onUpdateFrame(), this.speedValue); } private render() { diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx index 8b5678f0eb..7a671927e1 100644 --- a/gui/src/renderer/app.tsx +++ b/gui/src/renderer/app.tsx @@ -197,7 +197,7 @@ export default class AppRenderer { await IpcRendererEventChannel.account.set(accountToken); // Redirect the user after some time to allow for the 'Logged in' screen to be visible - this.loginTimer = setTimeout(async () => { + this.loginTimer = global.setTimeout(async () => { this.memoryHistory.replace('/connect'); try { @@ -640,7 +640,7 @@ export class AccountDataCache { log.warn(`Failed to fetch account data. Retrying in ${delay} ms`); - this.fetchRetryTimeout = setTimeout(() => { + this.fetchRetryTimeout = global.setTimeout(() => { this.fetchRetryTimeout = undefined; this.performFetch(accountToken); }, delay); diff --git a/gui/src/renderer/components/ClipboardLabel.tsx b/gui/src/renderer/components/ClipboardLabel.tsx index 41360340d8..fdb9982b3f 100644 --- a/gui/src/renderer/components/ClipboardLabel.tsx +++ b/gui/src/renderer/components/ClipboardLabel.tsx @@ -43,7 +43,7 @@ export default class ClipboardLabel extends Component<IProps, IState> { clearTimeout(this.timer); } - this.timer = setTimeout(() => this.setState({ showsMessage: false }), this.props.delay); + this.timer = global.setTimeout(() => this.setState({ showsMessage: false }), this.props.delay); this.setState({ showsMessage: true }); Clipboard.setText(this.props.value); diff --git a/gui/src/renderer/components/CustomScrollbars.tsx b/gui/src/renderer/components/CustomScrollbars.tsx index b2353b4014..d909dd79dd 100644 --- a/gui/src/renderer/components/CustomScrollbars.tsx +++ b/gui/src/renderer/components/CustomScrollbars.tsx @@ -313,7 +313,7 @@ export default class CustomScrollbars extends React.Component<IProps, IState> { if (this.autoHideTimer) { clearTimeout(this.autoHideTimer); } - this.autoHideTimer = setTimeout(() => { + this.autoHideTimer = global.setTimeout(() => { this.setState({ showScrollIndicators: false, showTrack: false, @@ -327,7 +327,7 @@ export default class CustomScrollbars extends React.Component<IProps, IState> { clearTimeout(this.autoHideTimer); } - this.autoHideTimer = setTimeout(() => { + this.autoHideTimer = global.setTimeout(() => { this.setState({ showTrack: false, isWide: false, |
