diff --git a/frontend/src/basic/Main.tsx b/frontend/src/basic/Main.tsx index 137b874e..1c1b021e 100644 --- a/frontend/src/basic/Main.tsx +++ b/frontend/src/basic/Main.tsx @@ -10,8 +10,6 @@ import Notifications from '../components/Notifications'; import { useTranslation } from 'react-i18next'; import { GarageContext, type UseGarageStoreType } from '../contexts/GarageContext'; -//const Router = window.NativeRobosats === undefined ? BrowserRouter : MemoryRouter; - const Router = (window.NativeRobosats === undefined && window.DesktopRobosats === undefined)? BrowserRouter : window.DesktopRobosats === 'Desktop-App' ? HashRouter : MemoryRouter; const TestnetTypography = styled(Typography)({ diff --git a/frontend/src/components/RobotAvatar/index.tsx b/frontend/src/components/RobotAvatar/index.tsx index 8c538d51..aacf98ae 100644 --- a/frontend/src/components/RobotAvatar/index.tsx +++ b/frontend/src/components/RobotAvatar/index.tsx @@ -73,7 +73,7 @@ const RobotAvatar: React.FC = ({ if (shortAlias !== undefined) { if (window.NativeRobosats === undefined) { setAvatarSrc( - `${hostUrl.substring(hostUrl.indexOf("http://")+7)}/static/federation/avatars/${shortAlias}${small ? '.small' : ''}.webp`, + `${hostUrl}/static/federation/avatars/${shortAlias}${small ? '.small' : ''}.webp`, ); } else { setAvatarSrc( diff --git a/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx b/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx index 43de3a8f..bccc035e 100644 --- a/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx +++ b/frontend/src/components/TradeBox/EncryptedChat/EncryptedTurtleChat/index.tsx @@ -39,7 +39,7 @@ const audioPath = window.NativeRobosats === undefined ? '/static/assets/sounds' : 'file:///android_asset/Web.bundle/assets/sounds'; - + const EncryptedTurtleChat: React.FC = ({ order, userNick, diff --git a/frontend/src/contexts/AppContext.tsx b/frontend/src/contexts/AppContext.tsx index 3ff4273c..991e165c 100644 --- a/frontend/src/contexts/AppContext.tsx +++ b/frontend/src/contexts/AppContext.tsx @@ -89,7 +89,7 @@ const getHostUrl = (network = 'mainnet'): string => { host = defaultFederation.exp[network]['onion']; protocol = 'http:'; } - const hostUrl = `${protocol}//${host}`; + const hostUrl = `${host}`; return hostUrl; }; diff --git a/frontend/src/geo/Web.js b/frontend/src/geo/Web.js index d74fbfaf..973d15bb 100644 --- a/frontend/src/geo/Web.js +++ b/frontend/src/geo/Web.js @@ -1,6 +1,6 @@ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type export const getWorldmapGeojson = async (apiClient, baseUrl) => { - return apiClient.get(baseUrl.substring(baseUrl.indexOf("http://")+7), '/static/assets/geo/countries-coastline-10km.geo.json'); + return apiClient.get(baseUrl, '/static/assets/geo/countries-coastline-10km.geo.json'); }; export default getWorldmapGeojson; diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index ebbfd454..615dff5d 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -21,7 +21,7 @@ export class Federation { // Do not add `Local Dev` unless it is running on localhost return acc; } else { - acc[key] = new Coordinator(value, origin, settings, hostUrl.substring(hostUrl.indexOf("http://")+7)); + acc[key] = new Coordinator(value, origin, settings, hostUrl); return acc; }