Fix display for update popup

This commit is contained in:
Manfred Karrer 2016-04-26 21:34:03 +02:00
parent ae85d4e3a7
commit 96764394bd
2 changed files with 10 additions and 5 deletions

View file

@ -67,6 +67,12 @@ public final class Alert implements StoragePayload {
return signatureAsBase64;
}
public boolean isNewVersion() {
int versionNum = Integer.valueOf(Version.VERSION.replace(".", ""));
int alertVersionNum = Integer.valueOf(version.replace(".", ""));
return versionNum < alertVersionNum;
}
@Override
public long getTTL() {
return TTL;

View file

@ -823,11 +823,10 @@ public class MainViewModel implements ViewModel {
private void displayAlertIfPresent(Alert alert) {
boolean alreadyDisplayed = alert != null && alert.equals(user.getDisplayedAlert());
user.setDisplayedAlert(alert);
if (alert != null && !alreadyDisplayed) {
if (!alert.isUpdateInfo || !alert.version.equals(Version.VERSION))
new DisplayAlertMessageWindow().alertMessage(alert).show();
}
if (alert != null &&
!alreadyDisplayed &&
(!alert.isUpdateInfo || alert.isNewVersion()))
new DisplayAlertMessageWindow().alertMessage(alert).show();
}
private void swapPendingOfferFundingEntries() {