The personal finance app for everyone
Sync family icon button
Zach Gollwitzer3fb379d14079
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rbindex 0b2252d7..b78c54ad 100644--- a/app/controllers/accounts_controller.rb+++ b/app/controllers/accounts_controller.rb@@ -9,6 +9,11 @@ class AccountsController < ApplicationControllerrender layout: "settings"end+ def sync_all+ family.sync_later+ redirect_to accounts_path, notice: "Syncing accounts..."+ end+def show@chart_view = params[:chart_view] || "balance"@tab = params[:tab]diff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erbindex ff45d33f..3557ceb8 100644--- a/app/views/accounts/index.html.erb+++ b/app/views/accounts/index.html.erb@@ -2,6 +2,14 @@<h1 class="text-xl"><%= t(".accounts") %></h1><div class="flex items-center gap-5"><div class="flex items-center gap-2">+ <%= icon(+ "refresh-cw",+ as_button: true,+ size: "sm",+ href: sync_all_accounts_path,+ disabled: Current.family.syncing?,+ frame: :_top+ ) %><%= render DS::Link.new(text: "New account",href: new_account_path(return_to: accounts_path),diff --git a/config/routes.rb b/config/routes.rbindex a44554d6..d6c2bc7a 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -162,6 +162,10 @@ Rails.application.routes.draw doget :sparklinepatch :toggle_activeend++ collection do+ post :sync_all+ endend# Convenience routes for polymorphic paths