mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Onboarding redirect tests and trial status bar (#2197)
* Onboarding redirect tests and trial status bar * use helper method * Fix time tolerance failure * Update post-onboarding message to be generic * Disable turbo frames on Trial start button * Update flash notice in test
This commit is contained in:
parent
bc7e32deab
commit
441f436187
9 changed files with 110 additions and 18 deletions
|
@ -18,11 +18,7 @@ module Onboardable
|
|||
return unless Current.user
|
||||
return unless redirectable_path?(request.path)
|
||||
|
||||
# Check if trial was started VERY recently (e.g., within the last few seconds)
|
||||
# If so, assume onboarding was just completed in the previous request, even if onboarded_at appears blank momentarily.
|
||||
trial_just_started = Current.family.trial_started_at.present? && Current.family.trial_started_at > 10.seconds.ago
|
||||
|
||||
if Current.user.onboarded_at.blank? && !trial_just_started
|
||||
if !Current.user.onboarded?
|
||||
redirect_to onboarding_path
|
||||
elsif !Current.family.subscribed? && !Current.family.trialing? && !self_hosted?
|
||||
redirect_to upgrade_subscription_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue