Skip to content

Commit

Permalink
Merge pull request #6164 from jmacxx/popup_trading_rules
Browse files Browse the repository at this point in the history
Add popup reminder to inform users of trading rules
  • Loading branch information
ripcurlx authored Apr 28, 2022
2 parents 6d3863d + 36165f6 commit b71ffc2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4278,3 +4278,10 @@ news.bsqSwap.description=BSQ swaps is a new trade protocol for atomically swappi
This saves miner fees, allows instant trades, removes counterparty risk, and does not require \
mediation or arbitration support. No account setup is required either.\n\n\
See more about BSQ swaps in documentation [HYPERLINK:https://bisq.wiki/BSQ_swaps].
news.mediationRules.title=Rules for Successful Trading
news.mediationRules.info=We'd like to ask you to make yourself familiar with Bisq's trading \
rules [HYPERLINK:https://bisq.wiki/Trading_rules], and the penalties [HYPERLINK:https://bisq.wiki/Table_of_penalties] \
for breaking them. Please check the following linked resources.\n\n\
"KNOW THE PENALTIES TO AVOID THE PENALTIES"\n\n\
Sincerely,\n\
The Bisq Support Team -- on Matrix: [HYPERLINK:https://bisq.chat].
15 changes: 15 additions & 0 deletions desktop/src/main/java/bisq/desktop/main/MainViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public void onSetupComplete() {
setupDevDummyPaymentAccounts();
}

maybeAddMediationRulesAwarenessWindowToQueue();
getShowAppScreen().set(true);
}

Expand Down Expand Up @@ -889,6 +890,20 @@ public BooleanProperty getShowSettingsUpdatesNotification() {
return settingsPresentation.getShowSettingsUpdatesNotification();
}

private void maybeAddMediationRulesAwarenessWindowToQueue() {
String key = "mediationRulesAwarenessPopup";
if (DontShowAgainLookup.showAgain(key)) {
Popup popup = new Popup()
.headLine(Res.get("news.mediationRules.title"))
.information(Res.get("news.mediationRules.info"))
.actionButtonText(Res.get("shared.iUnderstand"))
.hideCloseButton()
.dontShowAgainId(key);
popup.setDisplayOrderPriority(1);
popupQueue.add(popup);
}
}

private void maybeShowPopupsFromQueue() {
if (!popupQueue.isEmpty()) {
Overlay<?> overlay = popupQueue.poll();
Expand Down

0 comments on commit b71ffc2

Please sign in to comment.