From a9b61a655b79664c5be869985c6581b7f0bae8e5 Mon Sep 17 00:00:00 2001 From: Josh Pigford Date: Tue, 26 Nov 2024 07:45:00 -0600 Subject: [PATCH] Synth error handling (#1502) * Synth error handling * Revert "Synth error handling" This reverts commit fd6a0a12b49eee23ad8d7473ef15c12cf425e0c4. * Simplify overage messaging --- app/models/family.rb | 4 ++++ app/views/pages/dashboard.html.erb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/app/models/family.rb b/app/models/family.rb index 1f8cc561..b4bb2d4c 100644 --- a/app/models/family.rb +++ b/app/models/family.rb @@ -153,6 +153,10 @@ class Family < ApplicationRecord self.class.synth_provider&.usage end + def synth_overage? + self.class.synth_provider && self.class.synth_provider.usage.utilization >= 1 + end + def subscribed? stripe_subscription_status == "active" end diff --git a/app/views/pages/dashboard.html.erb b/app/views/pages/dashboard.html.erb index 666cf509..a2e5c66b 100644 --- a/app/views/pages/dashboard.html.erb +++ b/app/views/pages/dashboard.html.erb @@ -1,4 +1,9 @@
+ <% if self_hosted? && Current.family&.synth_overage? %> + + <% end %>

<%= t(".title") %>