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

Add popup reminder to inform users of trading rules #6164

Merged
merged 1 commit into from Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
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