From 4e2535e4715ef4e33fcc9fd0b1ae6c30e7f1eb70 Mon Sep 17 00:00:00 2001 From: gogabidzia Date: Mon, 5 Sep 2022 13:13:17 +0400 Subject: [PATCH] Update getIp.js, fails on ubuntu In ubuntu `ip.family` is returned as a number. --- src/utils/getIp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/getIp.js b/src/utils/getIp.js index 4b30717..a740d22 100644 --- a/src/utils/getIp.js +++ b/src/utils/getIp.js @@ -3,4 +3,4 @@ import { networkInterfaces } from 'os'; export const getIp = () => Object.values(networkInterfaces()) .flat() - .find(ip => ip.family == 'IPv4' && !ip.internal).address; + .find(ip => (ip.family == 'IPv4' || ip.family == 4) && !ip.internal).address;