Created
April 4, 2017 11:24
-
-
Save glnix/e04d6fb3e02ec7bedd9a1b0143529c67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Mobile.class */ | |
/* @Inject static UBRRUserService userService; */ | |
List<ExternalAuthOption> authOptions = emptyList(); | |
List<ExternalAuthOption> maskedAuthOptions = emptyList(); | |
if (!isDemoMode()) { | |
authOptions = userService.getAuthListFromCards(user); | |
maskedAuthOptions = userService.externalAuthOptions(user); | |
} | |
String defaultPhone = authOptionsMatching(authOptions, maskedAuthOptions); | |
boolean registerForPush = (session.contains("simpleLogin") || session.contains("saveSimpleLoginHash") | |
|| flash.contains("showPinPadAfterLogout")) && feature.isSimpleLoginEnabled(); | |
render(getAppVersion() >= newAppVersion ? "Mobile2/overview.html" : "Mobile/overview.html", | |
account, accounts, loginKey, hideAdvertisingForWebVersion, splashAd, simpleHash, rates, | |
otherBankCards, authOptions, newOffersAmount, highlightOffer, sumkaOffersAmount, registerForPush, defaultPhone); | |
/* UserService.class - ??? */ | |
public ExternalAuthOption findDefaultExternalAuthOptionForPhone(List<ExternalAuthOption> authOptions) { | |
for (ExternalAuthOption authOption : authOptions) { | |
if (authOption.defaultOption) { | |
return authOption; | |
} | |
} | |
return null; | |
} | |
/* overview.html */ | |
#{if registerForPush} | |
<script> | |
console.log('Default phone is ${defaultPhone}'); | |
cordova.exec($.noop, $.noop, 'IbankApp', 'registerPushWithPhoneNumber', ['${defaultPhone}']); | |
</script> | |
#{/if} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment