1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Tweak sync states

This commit is contained in:
Zach Gollwitzer 2025-05-14 14:16:46 -04:00
parent 153bffcaf2
commit b041edb648
6 changed files with 13 additions and 8 deletions

View file

@ -31,8 +31,4 @@ class SessionsController < ApplicationController
def set_session
@session = Current.user.sessions.find(params[:id])
end
def session_params
params.require(:session).permit(:tab_key, :tab_value)
end
end

View file

@ -1,7 +1,7 @@
class SyncMarketDataJob < ApplicationJob
queue_as :scheduled
def perform(*args)
def perform
MarketDataSyncer.new.sync_all
end
end

View file

@ -12,7 +12,8 @@ class Account::Syncer
def perform_post_sync
account.family.auto_match_transfers!
account.family.broadcast_refresh
account.broadcast_refresh
account.family.broadcast_sidebar_refresh
end
private

View file

@ -44,6 +44,14 @@ class Family < ApplicationRecord
.exists?
end
def broadcast_sidebar_refresh
broadcast_replace(
target: "account-sidebar-tabs",
partial: "accounts/sidebar_tabs",
locals: { family: self, active_account_group_tab: "all" }
)
end
def assigned_merchants
merchant_ids = transactions.where.not(merchant_id: nil).pluck(:merchant_id).uniq
Merchant.where(id: merchant_ids)

View file

@ -24,7 +24,7 @@ class PlaidItem::Syncer
def perform_post_sync
plaid_item.auto_match_categories!
plaid_item.family.broadcast_refresh
plaid_item.family.broadcast_sidebar_refresh
end
private

View file

@ -1,4 +1,4 @@
<%# locals: (family:, active_account_group_tab: "assets") %>
<%# locals: (family:, active_account_group_tab: "asset") %>
<div id="account-sidebar-tabs">
<% if family.missing_data_provider? %>