Hopefully fix crash

This commit is contained in:
nielsandriesse 2020-09-24 09:43:18 +10:00
parent 41041071f4
commit b2b2c36ecb
3 changed files with 4 additions and 2 deletions

View File

@ -216,7 +216,9 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
resubmitProfilePictureIfNeeded(); resubmitProfilePictureIfNeeded();
publicChatManager = new PublicChatManager(this); publicChatManager = new PublicChatManager(this);
updateOpenGroupProfilePicturesIfNeeded(); updateOpenGroupProfilePicturesIfNeeded();
if (userPublicKey != null) {
registerForFCMIfNeeded(false); registerForFCMIfNeeded(false);
}
// Set application UI mode (day/night theme) to the user selected one. // Set application UI mode (day/night theme) to the user selected one.
UiModeUtilities.setupUiModeToUserSelected(this); UiModeUtilities.setupUiModeToUserSelected(this);
// ======== // ========

View File

@ -172,6 +172,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity, ConversationClickListe
SessionManagementProtocol.configureIfNeeded(sessionResetImpl, sskDatabase, application) SessionManagementProtocol.configureIfNeeded(sessionResetImpl, sskDatabase, application)
MultiDeviceProtocol.configureIfNeeded(apiDB) MultiDeviceProtocol.configureIfNeeded(apiDB)
IP2Country.configureIfNeeded(this) IP2Country.configureIfNeeded(this)
application.registerForFCMIfNeeded(false)
// Preload device links to make message sending quicker // Preload device links to make message sending quicker
val publicKeys = ContactUtilities.getAllContacts(this).filter { contact -> val publicKeys = ContactUtilities.getAllContacts(this).filter { contact ->
!contact.recipient.isGroupRecipient && !contact.isOurDevice && !contact.isSlave !contact.recipient.isGroupRecipient && !contact.isOurDevice && !contact.isSlave

View File

@ -158,7 +158,6 @@ class PNModeActivity : BaseActionBarActivity() {
val application = ApplicationContext.getInstance(this) val application = ApplicationContext.getInstance(this)
application.setUpStorageAPIIfNeeded() application.setUpStorageAPIIfNeeded()
application.setUpP2PAPIIfNeeded() application.setUpP2PAPIIfNeeded()
application.registerForFCMIfNeeded(true)
val intent = Intent(this, HomeActivity::class.java) val intent = Intent(this, HomeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
show(intent) show(intent)