Merge pull request #11268 from howard-stearns/fix-wallet-login

fix wallet login (and share code with snapshot login)
This commit is contained in:
Zach Fox 2017-08-29 16:26:51 -07:00 committed by GitHub
commit c0d9c06067
3 changed files with 21 additions and 18 deletions

View file

@ -14,7 +14,7 @@
/*global XXX */ /*global XXX */
(function () { // BEGIN LOCAL_SCOPE (function () { // BEGIN LOCAL_SCOPE
Script.include("/~/system/libraries/accountUtils.js");
// Function Name: onButtonClicked() // Function Name: onButtonClicked()
// //
@ -59,13 +59,7 @@
tablet.gotoHomeScreen(); tablet.gotoHomeScreen();
break; break;
case 'walletSetup_loginClicked': case 'walletSetup_loginClicked':
if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar", false)) openLoginWindow();
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar", true))) {
Menu.triggerOption("Login / Sign Up");
tablet.gotoHomeScreen();
} else {
tablet.loadQMLOnTop("../../../dialogs/TabletLoginDialog.qml");
}
break; break;
default: default:
print('Unrecognized message from QML:', JSON.stringify(message)); print('Unrecognized message from QML:', JSON.stringify(message));

View file

@ -0,0 +1,16 @@
//
// accountUtils.js
// scripts/system/libraries/libraries
//
// Copyright 2017 High Fidelity, Inc.
//
openLoginWindow = function openLoginWindow() {
if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar", false))
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar", true))) {
Menu.triggerOption("Login / Sign Up");
} else {
tablet.loadQMLOnTop("../../dialogs/TabletLoginDialog.qml");
HMD.openTablet();
}
};

View file

@ -10,7 +10,8 @@
/* globals Tablet, Script, HMD, Settings, DialogsManager, Menu, Reticle, OverlayWebWindow, Desktop, Account, MyAvatar, Snapshot */ /* globals Tablet, Script, HMD, Settings, DialogsManager, Menu, Reticle, OverlayWebWindow, Desktop, Account, MyAvatar, Snapshot */
/* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */ /* eslint indent: ["error", 4, { "outerIIFEBody": 0 }] */
(function() { // BEGIN LOCAL_SCOPE (function () { // BEGIN LOCAL_SCOPE
Script.include("/~/system/libraries/accountUtils.js");
var SNAPSHOT_DELAY = 500; // 500ms var SNAPSHOT_DELAY = 500; // 500ms
var FINISH_SOUND_DELAY = 350; var FINISH_SOUND_DELAY = 350;
@ -52,15 +53,7 @@ try {
print('Failed to resolve request api, error: ' + err); print('Failed to resolve request api, error: ' + err);
} }
function openLoginWindow() {
if ((HMD.active && Settings.getValue("hmdTabletBecomesToolbar", false))
|| (!HMD.active && Settings.getValue("desktopTabletBecomesToolbar", true))) {
Menu.triggerOption("Login / Sign Up");
} else {
tablet.loadQMLOnTop("../../dialogs/TabletLoginDialog.qml");
HMD.openTablet();
}
}
function removeFromStoryIDsToMaybeDelete(story_id) { function removeFromStoryIDsToMaybeDelete(story_id) {
storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(story_id), 1); storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(story_id), 1);