fix host change for local shared album

This commit is contained in:
Abhinav 2022-01-25 16:15:30 +05:30
parent 94a0c07430
commit 041e995baf

View file

@ -17,6 +17,7 @@ import constants from 'utils/strings/constants';
import { Collection } from 'types/collection'; import { Collection } from 'types/collection';
import { CollectionType } from 'constants/collection'; import { CollectionType } from 'constants/collection';
import CryptoWorker from 'utils/crypto'; import CryptoWorker from 'utils/crypto';
import { getAlbumSiteHost } from 'constants/pages';
export enum COLLECTION_OPS_TYPE { export enum COLLECTION_OPS_TYPE {
ADD, ADD,
@ -119,7 +120,7 @@ export async function appendCollectionKeyToShareURL(
} }
const sharableURL = new URL(url); const sharableURL = new URL(url);
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
sharableURL.host = 'localhost:3001'; sharableURL.host = getAlbumSiteHost();
sharableURL.protocol = 'http'; sharableURL.protocol = 'http';
} }
sharableURL.hash = await worker.toHex(collectionKey); sharableURL.hash = await worker.toHex(collectionKey);