((resolve, reject) => {
- CoreDomUtils.showAlertWithOptions({
- header: Translate.instant('core.login.faqwhereisqrcode'),
- message: Translate.instant(
- 'core.login.faqwhereisqrcodeanswer',
- { $image: CoreLoginHelperProvider.FAQ_QRCODE_IMAGE_HTML },
- ),
- buttons: [
- {
- text: Translate.instant('core.cancel'),
- role: 'cancel',
- handler: () => reject(new CoreCanceledError()),
- },
- {
- text: Translate.instant('core.next'),
- handler: () => resolve(),
- },
- ],
- });
- });
+ const dontShowWarning = await CoreConfig.get(CoreLoginHelperProvider.FAQ_QRCODE_INFO_DONE, 0);
+ if (dontShowWarning) {
+ return;
+ }
+
+ const message = Translate.instant(
+ 'core.login.faqwhereisqrcodeanswer',
+ { $image: ''+ CoreLoginHelperProvider.FAQ_QRCODE_IMAGE_HTML + '
' },
+ );
+ const header = Translate.instant('core.login.faqwhereisqrcode');
+
+ try {
+ const dontShowAgain = await CoreDomUtils.showPrompt(
+ message,
+ header,
+ Translate.instant('core.dontshowagain'),
+ 'checkbox',
+ { okText: Translate.instant('core.next'), cancelText: Translate.instant('core.cancel') },
+ );
+
+ if (dontShowAgain) {
+ CoreConfig.set(CoreLoginHelperProvider.FAQ_QRCODE_INFO_DONE, 1);
+ }
+ } catch {
+ // User canceled.
+ throw new CoreCanceledError('');
+ }
}
/**
diff --git a/src/core/features/settings/pages/dev/dev.ts b/src/core/features/settings/pages/dev/dev.ts
index c916950cb08..532f59c60c6 100644
--- a/src/core/features/settings/pages/dev/dev.ts
+++ b/src/core/features/settings/pages/dev/dev.ts
@@ -165,6 +165,7 @@ export class CoreSettingsDevPage implements OnInit {
await CoreUserTours.resetTours();
await CoreConfig.delete(CoreLoginHelperProvider.ONBOARDING_DONE);
+ await CoreConfig.delete(CoreLoginHelperProvider.FAQ_QRCODE_INFO_DONE);
CoreDomUtils.showToast('User tours have been reseted');
}