@ -5,11 +5,14 @@ import android.os.Bundle
import androidx.activity.viewModels
import androidx.activity.viewModels
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.getValue
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import network.loki.messenger.R
import network.loki.messenger.R
import org.session.libsession.utilities.TextSecurePreferences
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.BaseActionBarActivity
import org.thoughtcrime.securesms.ui.setComposeContent
import org.thoughtcrime.securesms.ui.setComposeContent
@AndroidEntryPoint
class RecoveryPasswordActivity : BaseActionBarActivity ( ) {
class RecoveryPasswordActivity : BaseActionBarActivity ( ) {
companion object {
companion object {
@ -18,6 +21,8 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
private val viewModel : RecoveryPasswordViewModel by viewModels ( )
private val viewModel : RecoveryPasswordViewModel by viewModels ( )
@Inject lateinit var prefs : TextSecurePreferences
override fun onCreate ( savedInstanceState : Bundle ? ) {
override fun onCreate ( savedInstanceState : Bundle ? ) {
super . onCreate ( savedInstanceState )
super . onCreate ( savedInstanceState )
supportActionBar !! . title = resources . getString ( R . string . sessionRecoveryPassword )
supportActionBar !! . title = resources . getString ( R . string . sessionRecoveryPassword )
@ -33,10 +38,20 @@ class RecoveryPasswordActivity : BaseActionBarActivity() {
val returnIntent = Intent ( )
val returnIntent = Intent ( )
returnIntent . putExtra ( RESULT _RECOVERY _HIDDEN , true )
returnIntent . putExtra ( RESULT _RECOVERY _HIDDEN , true )
setResult ( RESULT _OK , returnIntent )
setResult ( RESULT _OK , returnIntent )
// The returnIntent assumes we're going back to the SettingsActivity, which handles the result - but
// if we entered this activity through the recovery phrase banner then we're going back to the
// HomeActivity, which does not. As such we'll write the change here to cover all our bases.
prefs . setHidePassword ( true )
finish ( )
finish ( )
} ,
} ,
copyMnemonic = viewModel :: copyMnemonic
copyMnemonic = viewModel :: copyMnemonic
)
)
}
}
// Set the seed as having been viewed when the user has seen this activity, which
// removes the reminder banner on the HomeActivity.
prefs . setHasViewedSeed ( true )
}
}
}
}