mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Synth error handling (#1502)
* Synth error handling
* Revert "Synth error handling"
This reverts commit fd6a0a12b4
.
* Simplify overage messaging
This commit is contained in:
parent
955f211fe0
commit
a9b61a655b
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
<div class="space-y-4">
|
||||
<% if self_hosted? && Current.family&.synth_overage? %>
|
||||
<div class="bg-yellow-100 border border-yellow-400 text-yellow-700 px-4 py-3 rounded relative" role="alert">
|
||||
Your Synth API credit limit has been exceeded. Please visit your <a href="https://dashboard.synthfinance.com/settings" class="font-medium underline hover:text-yellow-900">Synth billing settings</a> to upgrade your plan or wait for your credits to reset.
|
||||
</div>
|
||||
<% end %>
|
||||
<header class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="sr-only"><%= t(".title") %></h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue