fix condition

This commit is contained in:
Ildar Kamalov 2019-08-22 18:50:58 +03:00
parent 0bd722c426
commit c8052c23d1

View file

@ -139,10 +139,10 @@ export const getWebAddress = (ip, port = '') => {
const isStandardWebPort = port === STANDARD_WEB_PORT;
let address = `http://${ip}`;
if (port) {
if (ip.includes(':') && !ip.includes('[') && !isStandardWebPort) {
if (port && !isStandardWebPort) {
if (ip.includes(':') && !ip.includes('[')) {
address = `http://[${ip}]:${port}`;
} else if (!isStandardWebPort) {
} else {
address = `http://${ip}:${port}`;
}
}