demo is just a constant, not a setting

This commit is contained in:
Girish Ramakrishnan
2023-08-04 14:13:30 +05:30
parent d79d24efad
commit 6aad89ae6e
10 changed files with 21 additions and 24 deletions

View File

@@ -1385,7 +1385,7 @@ async function install(data, auditSource) {
error = validateEnv(env);
if (error) throw error;
if (settings.isDemo() && constants.DEMO_BLACKLISTED_APPS.includes(appStoreId)) throw new BoxError(BoxError.BAD_FIELD, 'This app is blacklisted in the demo');
if (constants.DEMO && constants.DEMO_BLACKLISTED_APPS.includes(appStoreId)) throw new BoxError(BoxError.BAD_FIELD, 'This app is blacklisted in the demo');
// sendmail is enabled by default
const enableMailbox = 'enableMailbox' in data ? data.enableMailbox : true;
@@ -1406,7 +1406,7 @@ async function install(data, auditSource) {
error = await validateLocations(locations);
if (error) throw error;
if (settings.isDemo() && (await getCount() >= constants.DEMO_APP_LIMIT)) throw new BoxError(BoxError.BAD_STATE, 'Too many installed apps, please uninstall a few and try again');
if (constants.DEMO && (await getCount() >= constants.DEMO_APP_LIMIT)) throw new BoxError(BoxError.BAD_STATE, 'Too many installed apps, please uninstall a few and try again');
const appId = uuid.v4();
debug('Will install app with id : ' + appId);