use env override for endpoint if is dev deployment
This commit is contained in:
parent
7edcc15c41
commit
55a7be0642
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue