Skip to content

Commit deb3617

Browse files
committed
fix(appstore): return if appstore is manually disabled
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> fix: camel case Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
1 parent a2cfcf3 commit deb3617

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/private/App/AppStore/Fetcher/AppFetcher.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,17 @@ public function setVersion(string $version, string $fileName = 'apps.json', bool
148148
$this->ignoreMaxVersion = $ignoreMaxVersion;
149149
}
150150

151-
152-
public function get($allowUnstable = false) {
151+
public function get($allowUnstable = false): array {
153152
$allowPreReleases = $allowUnstable || $this->getChannel() === 'beta' || $this->getChannel() === 'daily' || $this->getChannel() === 'git';
154153

154+
$appStoreEnabled = $this->config->getSystemValueBool('appstoreenabled', true);
155+
$internetAvailable = $this->config->getSystemValueBool('has_internet_connection', true);
156+
$isDefaultAppStore = $this->config->getSystemValueString('appstoreurl', self::APP_STORE_URL) === self::APP_STORE_URL;
157+
158+
if (!$appStoreEnabled || (!$internetAvailable && $isDefaultAppStore)) {
159+
return [];
160+
}
161+
155162
$apps = parent::get($allowPreReleases);
156163
if (empty($apps)) {
157164
$this->logger->warning('Could not get apps from the appstore', ['app' => 'appstoreFetcher']);

0 commit comments

Comments
 (0)