Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWN-9042, PWN-9043, PWN-9057, PWN-9050, PWN-9046 - device share fixes #1875

Merged
8 commits merged into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ class RestoreFlowDataLocalRepository(signUpDetailsStorage: UserSignUpDetailsStor
var torusKey: String? = null
set(value) {
field = value
torusKeyTimestamp = DateTimeUtils.getCurrentTimestampInSeconds()
torusKeyTimestamp = if (value == null) {
This conversation was marked as resolved.
Show resolved Hide resolved
0
} else {
DateTimeUtils.getCurrentTimestampInSeconds()
}

Timber.tag(TAG).i("torusKey is generated and set: ${torusKey?.length}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.p2p.wallet.databinding.FragmentRestoreErrorScreenBinding
import org.p2p.wallet.intercom.IntercomService
import org.p2p.wallet.root.SystemIconsStyle
import org.p2p.wallet.utils.args
import org.p2p.wallet.utils.emptyString
import org.p2p.wallet.utils.popAndReplaceFragment
import org.p2p.wallet.utils.viewbinding.viewBinding
import org.p2p.wallet.utils.withArgs
Expand Down Expand Up @@ -65,6 +66,7 @@ class RestoreErrorScreenFragment :
binding.toolbar.inflateMenu(R.menu.menu_onboarding_help)
binding.toolbar.setOnMenuItemClickListener {
if (it.itemId == R.id.helpItem) {
IntercomService.signIn(userId = emptyString())
IntercomService.showMessenger()
}
return@setOnMenuItemClickListener true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class DevicesPresenter(
deviceNameTimestampSec = DateTimeUtils.getCurrentTimestampInSeconds()
)
refreshDeviceShare(newMetadata)
view?.showSuccessDeviceChange()
}

private suspend fun refreshDeviceShare(newMetadata: GatewayOnboardingMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class UpdateDeviceSmsInputFragment : BaseSmsInputFragment() {
)
}

override fun navigateToGatewayErrorScreen(handledState: GatewayHandledState) = Unit
override fun navigateToGatewayErrorScreen(handledState: GatewayHandledState) {
showUiKitSnackBar(message = getString(R.string.error_general_message))
This conversation was marked as resolved.
Show resolved Hide resolved
}

override fun navigateToRestoreErrorScreen(handledState: RestoreFailureState.TitleSubtitleError) = Unit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ class UpdateDeviceSmsInputPresenter(
}

private fun handleGatewayError(error: PushServiceError) {
// TODO PWN-8827 fix error handling!
when (val gatewayHandledResult = gatewayServiceErrorHandler.handle(error)) {
is GatewayHandledState.CriticalError -> {
view?.navigateToGatewayErrorScreen(gatewayHandledResult)
view?.showUiKitSnackBar(gatewayHandledResult.errorCode.toString())
}
GatewayHandledState.IncorrectOtpCodeError -> {
view?.renderIncorrectSms()
Expand All @@ -81,10 +79,9 @@ class UpdateDeviceSmsInputPresenter(
}
is GatewayHandledState.TitleSubtitleError -> {
view?.navigateToGatewayErrorScreen(gatewayHandledResult)
view?.showUiKitSnackBar(gatewayHandledResult.title)
}
is GatewayHandledState.ToastError -> {
view?.showUiKitSnackBar(gatewayHandledResult.message)
view?.navigateToGatewayErrorScreen(gatewayHandledResult)
}
else -> {
Timber.i("GatewayService error is not handled")
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/settings_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@


<string name="devices_incorrect_account">Incorrect Google account</string>
<string name="devices_account_associated">This account is associated with %s. Please log in with the correct Google account.</string>
<string name="devices_account_associated">%s\nPlease log in with the correct Google account.</string>
<string name="devices_restore_another">Use another account</string>


Expand Down