Add wrapstodon to initial state and show wrapstodon sidebar item on load (#37261)

This commit is contained in:
Claire authored and GitHub committed 2025-12-16 09:47:18 +00:00
1 parent 4c679c698f
commit 550a6d4765
5 files changed
+50 -17

No files matched your search

@@ -57,27 +57,18 @@ class Api::V1::AnnualReportsController < Api::BaseController
render_empty
end
def refresh_key
"wrapstodon:#{current_account.id}:#{year}"
end
private
def report_state
return 'available' if GeneratedAnnualReport.exists?(account_id: current_account.id, year: year)
async_refresh = AsyncRefresh.new(refresh_key)
if async_refresh.running?
AnnualReport.new(current_account, year).state do |async_refresh|
add_async_refresh_header(async_refresh, retry_seconds: 2)
'generating'
elsif AnnualReport.current_campaign == year && AnnualReport.new(current_account, year).eligible?
'eligible'
else
'ineligible'
end
end
def refresh_key
"wrapstodon:#{current_account.id}:#{year}"
end
def year
params[:id]&.to_i
end