[MM-51406] Update node-abi, fix some server modal bugs (#2617)

* Update node-abi so tests can run

* [MM-51392] Fix modal ping bugs
This commit is contained in:
Devin Binnie
2023-03-15 09:12:53 -04:00
committed by GitHub
parent 69831bbe13
commit cf8aa6499c
4 changed files with 23 additions and 23 deletions

View File

@@ -76,16 +76,16 @@ function ConfigureServer({
if (urlUtils.startsWithProtocol(checkURL)) {
return Promise.resolve(checkURL);
}
return window.desktop.modals.pingDomain(checkURL).then((result: string | Error) => {
let newURL = checkURL;
if (result instanceof Error) {
console.error(`Could not ping url: ${checkURL}`);
} else {
newURL = `${result}://${checkURL}`;
return window.desktop.modals.pingDomain(checkURL).
then((result: string) => {
const newURL = `${result}://${checkURL}`;
setUrl(newURL);
}
return newURL;
});
return newURL;
}).
catch(() => {
console.error(`Could not ping url: ${checkURL}`);
return checkURL;
});
};
const validateName = () => {

View File

@@ -156,13 +156,13 @@ class NewTeamModal extends React.PureComponent<Props, State> {
return Promise.resolve(undefined);
}
return window.desktop.modals.pingDomain(teamUrl).then((result: string | Error) => {
if (result instanceof Error) {
console.error(`Could not ping url: ${teamUrl}`);
} else {
return window.desktop.modals.pingDomain(teamUrl).
then((result: string) => {
this.setState({teamUrl: `${result}://${this.state.teamUrl}`});
}
});
}).
catch(() => {
console.error(`Could not ping url: ${teamUrl}`);
});
}
getError() {