host fixed

This commit is contained in:
amitpanwar789 2024-05-28 11:47:25 +05:30
parent 1cbab240ca
commit 0cf88efb6c
6 changed files with 5 additions and 7 deletions

View File

@ -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)({

View File

@ -73,7 +73,7 @@ const RobotAvatar: React.FC<Props> = ({
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(

View File

@ -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;
};

View File

@ -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;

View File

@ -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;
}