Skip to content

Commit

Permalink
fix: reset the show notifications flag when there is an app upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Aug 29, 2023
1 parent 904ff0c commit f174b95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class BootstrapReceiver extends BroadcastReceiver {
protected WalletDataProvider walletDataProvider;
@Inject
protected WalletApplication application;
@Inject
protected Configuration configuration;

@Override
public void onReceive(final Context context, final Intent intent) {
Expand Down Expand Up @@ -100,7 +102,11 @@ private void onAsyncReceive(final Context context, final Intent intent) {

// if the app hasn't been used for a while and contains coins, maybe show reminder
maybeShowInactivityNotification();
application.myPackageReplaced = packageReplaced;
application.myPackageReplaced = true;

// reset the notification explainer flag
if (packageReplaced)
configuration.setShowNotificationsExplainer(true);
} else if (ACTION_DISMISS.equals(action)) {
dismissNotification(context);
} else if (ACTION_DISMISS_FOREVER.equals(action)) {
Expand Down
4 changes: 2 additions & 2 deletions wallet/src/de/schildbach/wallet/ui/main/WalletActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected void onCreate(final Bundle savedInstanceState) {
public void onStart() {
super.onStart();

if (!getLockScreenDisplayed() && (configuration.getShowNotificationsExplainer() || walletApplication.myPackageReplaced)) {
if (!getLockScreenDisplayed() && configuration.getShowNotificationsExplainer()) {
explainPushNotifications();
}
}
Expand Down Expand Up @@ -368,7 +368,7 @@ public void onNewKeyChainEncrypted() {

@Override
public void onLockScreenDeactivated() {
if (configuration.getShowNotificationsExplainer() || walletApplication.myPackageReplaced) {
if (configuration.getShowNotificationsExplainer()) {
explainPushNotifications();
}
}
Expand Down

0 comments on commit f174b95

Please sign in to comment.