Skip to content

Commit 419a259

Browse files
authored
Mark Hello World as unnecessary when reregistering
1 parent 068febc commit 419a259

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Signal/Registration/RegistrationCoordinatorImpl.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,16 @@ public class RegistrationCoordinatorImpl: RegistrationCoordinator {
12071207
deps.tsAccountManager.setIsManualMessageFetchEnabled(inMemoryState.isManualMessageFetchEnabled, tx: tx)
12081208
}
12091209

1210+
func finalizeRegistration(tx: DBWriteTransaction) {
1211+
/// Disable PNI Hello World operations – these aren't necessary
1212+
/// since we are the only device and know that our
1213+
/// just-generated our PNI identity key is correct.
1214+
deps.pniHelloWorldManager.markHelloWorldAsUnnecessary(tx: tx)
1215+
1216+
writeState(tx)
1217+
persistLocalIdentifiers(tx: tx)
1218+
}
1219+
12101220
func setupContactsAndFinish() -> Guarantee<RegistrationStep> {
12111221
// Start syncing system contacts now that we have set up tsAccountManager.
12121222
deps.contactsManager.fetchSystemContactsOnceIfAlreadyAuthorized()
@@ -1236,22 +1246,14 @@ public class RegistrationCoordinatorImpl: RegistrationCoordinator {
12361246
/// Enable the onboarding banner cards.
12371247
self.deps.experienceManager.enableAllGetStartedCards(tx)
12381248
}
1239-
1240-
/// Disable PNI Hello World operations – these aren't necessary
1241-
/// since we are the only device and know that our
1242-
/// just-generated our PNI identity key is correct.
1243-
self.deps.pniHelloWorldManager.markHelloWorldAsUnnecessary(tx: tx)
1244-
1245-
writeState(tx)
1246-
persistLocalIdentifiers(tx: tx)
1249+
finalizeRegistration(tx: tx)
12471250
}
12481251
return setupContactsAndFinish()
12491252
}
12501253

12511254
case .reRegistering:
12521255
db.write { tx in
1253-
writeState(tx)
1254-
persistLocalIdentifiers(tx: tx)
1256+
finalizeRegistration(tx: tx)
12551257
}
12561258
return setupContactsAndFinish()
12571259

0 commit comments

Comments
 (0)