feat: max 6 apps in demo mode

This commit is contained in:
Nicolas Meienberger 2023-08-31 21:55:32 +02:00
parent f928a51570
commit b8be697e60
2 changed files with 8 additions and 1 deletions

View file

@ -33,7 +33,8 @@
"domain-already-in-use": "Domain {domain} is already in use by app {id}",
"could-not-get-latest-version": "Could not get latest version",
"current-version-is-latest": "Current version is already up to date",
"major-version-update": "The major version has changed. Please update manually (instructions on GitHub)"
"major-version-update": "The major version has changed. Please update manually (instructions on GitHub)",
"demo-mode-limit": "Only 6 apps can be installed in the demo mode. Please uninstall an other app to install a new one."
},
"success": {}
},

View file

@ -104,6 +104,12 @@ export class AppServiceClass {
if (app) {
await this.startApp(id);
} else {
const apps = await this.queries.getApps();
if (apps.length >= 6 && getConfig().demoMode) {
throw new TranslatedError('server-messages.errors.demo-mode-limit');
}
if (exposed && !domain) {
throw new TranslatedError('server-messages.errors.domain-required-if-expose-app');
}