Update DiscountHelper.java

This commit is contained in:
vshcherb 2018-06-20 16:27:24 +03:00 committed by GitHub
parent 473425a1a9
commit 0619c13f24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,9 +128,10 @@ public class DiscountHelper {
if (discountChanged) {
settings.DISCOUNT_TOTAL_SHOW.set(0);
}
// show after every N (getNumberOfStarts()) starts or show after every N (double show_day_frequency) frequency
if (discountChanged
|| (app.getAppInitializer().getNumberOfStarts() - settings.DISCOUNT_SHOW_NUMBER_OF_STARTS.get() >= showStartFrequency
&& System.currentTimeMillis() - settings.DISCOUNT_SHOW_DATETIME_MS.get() > 1000L * 60 * 60 * 24 * showDayFrequency) ) {
|| System.currentTimeMillis() - settings.DISCOUNT_SHOW_DATETIME_MS.get() > 1000L * 60 * 60 * 24 * showDayFrequency) ) {
if(settings.DISCOUNT_TOTAL_SHOW.get() < maxTotalShow){
settings.DISCOUNT_ID.set(discountId);
settings.DISCOUNT_TOTAL_SHOW.set(settings.DISCOUNT_TOTAL_SHOW.get() + 1);