use env override for endpoint if is dev deployment

This commit is contained in:
Abhinav 2022-12-09 12:40:13 +05:30
parent 7edcc15c41
commit 55a7be0642
2 changed files with 5 additions and 5 deletions

View file

@ -126,7 +126,7 @@ export function appendCollectionKeyToShareURL(
const albumsURL = new URL(getAlbumsURL());
sharableURL.protocol = albumsURL.protocol;
sharableURL.hostname = albumsURL.hostname;
sharableURL.host = albumsURL.host;
sharableURL.pathname = albumsURL.pathname;
const bytes = Buffer.from(collectionKey, 'base64');

View file

@ -45,10 +45,7 @@ export const getPaymentsURL = () => {
export const getAlbumsURL = () => {
const albumsURL = process.env.NEXT_PUBLIC_ENTE_PAYMENT_ENDPOINT;
if (
process.env.NEXT_PUBLIC_ENTE_DEV_APP_URL === window.location.origin &&
albumsURL
) {
if (isDevDeployment() && albumsURL) {
return albumsURL;
}
return `https://albums.ente.io`;
@ -69,3 +66,6 @@ export const getUploadEndpoint = () => {
}
return `https://uploader.ente.io`;
};
export const isDevDeployment = () =>
process.env.NEXT_PUBLIC_ENTE_DEV_APP_URL === window.location.origin;