Skip to content

Commit

Permalink
Hopefully fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsandriesse committed Sep 23, 2020
1 parent 4104107 commit b2b2c36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/org/thoughtcrime/securesms/ApplicationContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ public void onCreate() {
resubmitProfilePictureIfNeeded();
publicChatManager = new PublicChatManager(this);
updateOpenGroupProfilePicturesIfNeeded();
registerForFCMIfNeeded(false);
if (userPublicKey != null) {
registerForFCMIfNeeded(false);
}
// Set application UI mode (day/night theme) to the user selected one.
UiModeUtilities.setupUiModeToUserSelected(this);
// ========
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
SessionManagementProtocol.configureIfNeeded(sessionResetImpl, sskDatabase, application)
MultiDeviceProtocol.configureIfNeeded(apiDB)
IP2Country.configureIfNeeded(this)
application.registerForFCMIfNeeded(false)
// Preload device links to make message sending quicker
val publicKeys = ContactUtilities.getAllContacts(this).filter { contact ->
!contact.recipient.isGroupRecipient && !contact.isOurDevice && !contact.isSlave
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ class PNModeActivity : BaseActionBarActivity() {
val application = ApplicationContext.getInstance(this)
application.setUpStorageAPIIfNeeded()
application.setUpP2PAPIIfNeeded()
application.registerForFCMIfNeeded(true)
val intent = Intent(this, HomeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
show(intent)
Expand Down

0 comments on commit b2b2c36

Please sign in to comment.