Merge pull request #872 from ente-io/dev-deployment-true-for-test-release

testing setup
This commit is contained in:
Abhinav Kumar 2023-01-20 16:34:30 +05:30 committed by GitHub
commit 8f150a3788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -36,6 +36,7 @@ module.exports = (phase) =>
},
env: {
SENTRY_RELEASE: GIT_SHA,
NEXT_PUBLIC_IS_TEST_APP: process.env.IS_TEST_RELEASE,
},
headers() {

View file

@ -1,7 +1,12 @@
import { getData, LS_KEYS } from 'utils/storage/localStorage';
import { runningInBrowser } from '.';
export const getEndpoint = () => {
const endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
let endpoint = getData(LS_KEYS.API_ENDPOINT);
if (endpoint) {
return endpoint;
}
endpoint = process.env.NEXT_PUBLIC_ENTE_ENDPOINT;
if (isDevDeployment() && endpoint) {
return endpoint;
}
@ -91,6 +96,7 @@ const isDevDeployment = () => {
window.location.origin ||
process.env.NEXT_PUBLIC_ENTE_ALBUM_ENDPOINT ===
window.location.origin ||
process.env.NEXT_PUBLIC_IS_TEST_APP === 'true' ||
process.env.NODE_ENV === 'development'
);
}

View file

@ -19,6 +19,7 @@ export enum LS_KEYS {
USER_DETAILS = 'userDetails',
COLLECTION_SORT_BY = 'collectionSortBy',
THEME = 'theme',
API_ENDPOINT = 'apiEndpoint',
}
export const setData = (key: LS_KEYS, value: object) => {