mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Lunchflow fix (#307)
* Fix lunch flow pre-loading and UX * Small UX fixes - Proper closing of modal on cancel - Preload on new account already * Review comments * Fix json error * Delete .claude/settings.local.json Signed-off-by: soky srm <sokysrm@gmail.com> * Lunch Flow brand (again :-) * FIX process only linked accounts * FIX disable accounts with no name * Fix string normalization --------- Signed-off-by: soky srm <sokysrm@gmail.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
This commit is contained in:
@@ -69,31 +69,6 @@ module AccountableResource
|
||||
@show_us_link = Current.family.can_connect_plaid_us?
|
||||
@show_eu_link = Current.family.can_connect_plaid_eu?
|
||||
@show_lunchflow_link = Current.family.can_connect_lunchflow?
|
||||
|
||||
# Preload Lunchflow accounts if available and cache them
|
||||
if @show_lunchflow_link
|
||||
cache_key = "lunchflow_accounts_#{Current.family.id}"
|
||||
|
||||
@lunchflow_accounts = Rails.cache.fetch(cache_key, expires_in: 5.minutes) do
|
||||
begin
|
||||
lunchflow_provider = Provider::LunchflowAdapter.build_provider
|
||||
|
||||
if lunchflow_provider.present?
|
||||
accounts_data = lunchflow_provider.get_accounts
|
||||
accounts_data[:accounts] || []
|
||||
else
|
||||
[]
|
||||
end
|
||||
rescue Provider::Lunchflow::LunchflowError => e
|
||||
Rails.logger.error("Failed to preload Lunchflow accounts: #{e.message}")
|
||||
[]
|
||||
rescue StandardError => e
|
||||
Rails.logger.error("Unexpected error preloading Lunchflow accounts: #{e.class}: #{e.message}")
|
||||
Rails.logger.error(e.backtrace.join("\n"))
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def accountable_type
|
||||
|
||||
Reference in New Issue
Block a user