diff --git a/client/src/helpers/helpers.js b/client/src/helpers/helpers.js index 58117a07..7d44b400 100644 --- a/client/src/helpers/helpers.js +++ b/client/src/helpers/helpers.js @@ -190,6 +190,11 @@ export const getIpList = (interfaces) => Object.values(interfaces) .reduce((acc, curr) => acc.concat(curr.ip_addresses), []) .sort(); +/** + * @param {string} ip + * @param {number} [port] + * @returns {string} + */ export const getDnsAddress = (ip, port = 0) => { const isStandardDnsPort = port === STANDARD_DNS_PORT; let address = ip; @@ -205,6 +210,11 @@ export const getDnsAddress = (ip, port = 0) => { return address; }; +/** + * @param {string} ip + * @param {number} [port] + * @returns {string} + */ export const getWebAddress = (ip, port = 0) => { const isStandardWebPort = port === STANDARD_WEB_PORT; let address = `http://${ip}`; diff --git a/client/src/install/Setup/AddressList.js b/client/src/install/Setup/AddressList.js index 15cf7113..ed58127c 100644 --- a/client/src/install/Setup/AddressList.js +++ b/client/src/install/Setup/AddressList.js @@ -41,16 +41,13 @@ const AddressList = ({ AddressList.propTypes = { interfaces: PropTypes.object.isRequired, address: PropTypes.string.isRequired, - port: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), + port: PropTypes.number.isRequired, isDns: PropTypes.bool, }; renderItem.propTypes = { ip: PropTypes.string.isRequired, - port: PropTypes.string.isRequired, + port: PropTypes.number.isRequired, isDns: PropTypes.bool.isRequired, };