Clean up sync logic (#871)

This commit is contained in:
Zach Gollwitzer
2024-06-13 17:03:38 -04:00
committed by GitHub
parent d0a15b8a98
commit 957584b69c
4 changed files with 8 additions and 27 deletions

View File

@@ -2,20 +2,8 @@ class ApplicationController < ActionController::Base
include Authentication, Invitable, SelfHostable
include Pagy::Backend
before_action :sync_accounts
default_form_builder ApplicationFormBuilder
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
private
def sync_accounts
return if Current.user.blank?
if Current.user.last_login_at.nil? || Current.user.last_login_at.before?(Date.current.beginning_of_day)
Current.family.sync_accounts
end
end
end