webchannel pairing button test
This commit is contained in:
Родитель
6e3bf6d728
Коммит
6757eba2f1
|
@ -430,6 +430,7 @@ Start.prototype = {
|
|||
},
|
||||
|
||||
initializeNotificationChannel () {
|
||||
console.log('initializeNotificationChannel')
|
||||
if (! this._notificationChannel) {
|
||||
this._notificationChannel =
|
||||
new WebChannel(Constants.ACCOUNT_UPDATES_WEBCHANNEL_ID);
|
||||
|
|
|
@ -39,6 +39,7 @@ const COMMANDS = {
|
|||
/*
|
||||
SYNC_PREFERENCES: 'fxaccounts:sync_preferences', // Removed in issue #4250
|
||||
*/
|
||||
PAIR_PREFERENCES: 'fxaccounts:pair_preferences',
|
||||
VERIFIED: 'fxaccounts:verified',
|
||||
};
|
||||
|
||||
|
|
|
@ -134,6 +134,11 @@ define(function (require, exports, module) {
|
|||
});
|
||||
},
|
||||
|
||||
brokerPairingStart () {
|
||||
const channel = this._notificationChannel;
|
||||
return channel.send(channel.COMMANDS.PAIR_PREFERENCES);
|
||||
},
|
||||
|
||||
/**
|
||||
* Request FXA_STATUS info from the UA.
|
||||
*
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<div class="error"></div>
|
||||
<div class="success"></div>
|
||||
|
||||
<button id="pair-btn">Pair Btn</button>
|
||||
|
||||
<form novalidate>
|
||||
<div class="input-row">
|
||||
|
|
|
@ -78,7 +78,12 @@ define(function (require, exports, module) {
|
|||
},
|
||||
|
||||
events: {
|
||||
'blur input.email': 'onEmailBlur'
|
||||
'blur input.email': 'onEmailBlur',
|
||||
'click #pair-btn': 'onPairClick',
|
||||
},
|
||||
|
||||
onPairClick () {
|
||||
this.broker.brokerPairingStart();
|
||||
},
|
||||
|
||||
getPrefillEmail () {
|
||||
|
|
Загрузка…
Ссылка в новой задаче