From 171f6f46080188111a2c5bdbec3fb52ad0b347b6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 30 Mar 2024 00:23:48 +0100 Subject: [PATCH] fix: trial users subscription page --- app/Livewire/Subscription/Index.php | 2 +- bootstrap/helpers/shared.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Subscription/Index.php b/app/Livewire/Subscription/Index.php index c87f7d0b6..1444187ac 100644 --- a/app/Livewire/Subscription/Index.php +++ b/app/Livewire/Subscription/Index.php @@ -15,7 +15,7 @@ class Index extends Component if (!isCloud()) { return redirect(RouteServiceProvider::HOME); } - if (data_get(currentTeam(), 'subscription')) { + if (data_get(currentTeam(), 'subscription') && isSubscriptionActive()) { return redirect()->route('subscription.show'); } $this->settings = InstanceSettings::get(); diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 023a65107..baee4ce15 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -282,7 +282,7 @@ function base_url(bool $withPort = true): string function isSubscribed() { - return auth()->user()->currentTeam()->subscription()->exists() || auth()->user()->isInstanceAdmin(); + return isSubscriptionActive() || auth()->user()->isInstanceAdmin(); } function isDev(): bool {