MM-25831 Fix timing issue with cancelPing (#4394)
With `getUrl` recently [becoming async](https://github.com/mattermost/mattermost-mobile/commit/293470ff#diff-60b06b1c4aab028b96d9b207e84000c6R316), the global definition of the cancelPing function wasn't being made available in time for use by other functions (e.g. `handleSslProblem` and `handleConnect`)
This commit is contained in:
parent
21e1466068
commit
8a95000bd0
1 changed files with 4 additions and 4 deletions
|
|
@ -313,10 +313,6 @@ export default class SelectServer extends PureComponent {
|
|||
error: null,
|
||||
});
|
||||
|
||||
const serverUrl = await this.getUrl(url, !retryWithHttp);
|
||||
Client4.setUrl(serverUrl);
|
||||
handleServerUrlChanged(serverUrl);
|
||||
|
||||
let cancel = false;
|
||||
this.cancelPing = () => {
|
||||
cancel = true;
|
||||
|
|
@ -329,6 +325,10 @@ export default class SelectServer extends PureComponent {
|
|||
this.cancelPing = null;
|
||||
};
|
||||
|
||||
const serverUrl = await this.getUrl(url, !retryWithHttp);
|
||||
Client4.setUrl(serverUrl);
|
||||
handleServerUrlChanged(serverUrl);
|
||||
|
||||
try {
|
||||
const result = await getPing();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue