Skip to content

Commit

Permalink
Fix allowance check for pageview usage for active or recently ended t…
Browse files Browse the repository at this point in the history
…rial case
  • Loading branch information
zoldar committed Nov 21, 2024
1 parent 004cf17 commit faac8f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plausible_web/components/billing/plan_box.ex
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do

trial_active_or_ended_recently? =
not invited_user? &&
Plausible.Teams.Adapter.Read.Teams.trial_days_left(current_user) <= 10
Plausible.Teams.Adapter.Read.Teams.trial_days_left(current_user) >= -10

limit_checking_opts =
cond do
Expand Down
1 change: 1 addition & 0 deletions test/plausible_web/live/choose_plan_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ defmodule PlausibleWeb.Live.ChoosePlanTest do
user
|> Plausible.Auth.User.changeset(%{trial_expiry_date: Timex.shift(Timex.today(), days: -11)})
|> Repo.update!()
|> Plausible.Teams.sync_team()

generate_usage_for(site, 11_000)

Expand Down

0 comments on commit faac8f4

Please sign in to comment.