1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Synth error handling (#1502)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Synth error handling

* Revert "Synth error handling"

This reverts commit fd6a0a12b4.

* Simplify overage messaging
This commit is contained in:
Josh Pigford 2024-11-26 07:45:00 -06:00 committed by GitHub
parent 955f211fe0
commit a9b61a655b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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>