Fixed an incorrect push registration

pull/793/head
Morgan Pretty 1 year ago
parent ae6f609b41
commit 84daff6e3d

@ -20,8 +20,11 @@ public enum SyncPushTokensJob: JobExecutor {
failure: @escaping (Job, Error?, Bool) -> (), failure: @escaping (Job, Error?, Bool) -> (),
deferred: @escaping (Job) -> () deferred: @escaping (Job) -> ()
) { ) {
// Don't run when inactive or not in main app // Don't run when inactive or not in main app or if the user doesn't exist yet
guard (UserDefaults.sharedLokiProject?[.isMainAppActive]).defaulting(to: false) else { guard
(UserDefaults.sharedLokiProject?[.isMainAppActive]).defaulting(to: false),
Identity.userExists()
else {
deferred(job) // Don't need to do anything if it's not the main app deferred(job) // Don't need to do anything if it's not the main app
return return
} }

Loading…
Cancel
Save