fix: check apps before subscription on connection page

Move the empty apps check before the subscription check so that
an empty or unconfigured appConfig shows "not configured" instead
of the misleading "no subscription" message.
This commit is contained in:
c0mrade
2026-02-09 12:29:00 +03:00
parent 772d83d1c9
commit a4e6e35da1

View File

@@ -108,22 +108,7 @@ export default function Connection() {
);
}
// No subscription
if (!appConfig.hasSubscription) {
return (
<div className="flex flex-1 flex-col items-center justify-center p-8 text-center">
<h3 className="mb-2 text-xl font-bold text-dark-100">
{t('subscription.connection.title')}
</h3>
<p className="mb-4 text-dark-400">{t('subscription.connection.noSubscription')}</p>
<button onClick={handleGoBack} className="btn-primary px-6 py-2">
{t('common.close')}
</button>
</div>
);
}
// No apps configured
// No apps configured — check before subscription since empty config also has no subscription
if (!hasApps) {
return (
<div className="flex flex-1 flex-col items-center justify-center p-8 text-center">
@@ -177,6 +162,21 @@ export default function Connection() {
);
}
// No subscription
if (!appConfig.hasSubscription) {
return (
<div className="flex flex-1 flex-col items-center justify-center p-8 text-center">
<h3 className="mb-2 text-xl font-bold text-dark-100">
{t('subscription.connection.title')}
</h3>
<p className="mb-4 text-dark-400">{t('subscription.connection.noSubscription')}</p>
<button onClick={handleGoBack} className="btn-primary px-6 py-2">
{t('common.close')}
</button>
</div>
);
}
return (
<InstallationGuide
appConfig={appConfig}