From 6b83643d8995657582a1e7e381dcb5478e3aa3e5 Mon Sep 17 00:00:00 2001 From: Huong Nguyen <32060364+Huongg@users.noreply.github.com> Date: Thu, 23 May 2024 11:58:58 +0100 Subject: [PATCH] include gitpod in the list (#1923) Signed-off-by: huongg --- src/utils/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index d82777c7d2..c84615c78f 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -189,14 +189,12 @@ export const formatNumberWithCommas = (number) => { * @returns {Boolean} True if the app is running locally. */ export const isRunningLocally = () => { - const hosts = ['localhost', '127.0.0.1', 'demo.kedro.org']; - const itemFoundIndex = hosts.indexOf(window.location.hostname); + const hosts = ['localhost', '127.0.0.1', 'demo.kedro.org', 'gitpod']; + const itemFound = hosts.some((host) => + window.location.hostname.includes(host) + ); - if (itemFoundIndex === -1) { - return false; // The hostname isn't in our list of local hosts - } else { - return true; - } + return itemFound; }; /**