You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
890 B
JavaScript
42 lines
890 B
JavaScript
/* global i18n: false */
|
|
/* global Whisper: false */
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
// eslint-disable-next-line func-names
|
|
(function() {
|
|
'use strict';
|
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
Whisper.LauncherView = Whisper.View.extend({
|
|
className: 'launcher full-screen-flow standalone-fullscreen',
|
|
templateName: 'launcher',
|
|
events: {
|
|
'click #unlock-button': 'onLogin',
|
|
},
|
|
initialize() {
|
|
this.render();
|
|
},
|
|
render_attributes() {
|
|
return {
|
|
title: i18n('launcherViewTitle'),
|
|
buttonText: i18n('unlock'),
|
|
};
|
|
},
|
|
async onLogin() {
|
|
const passPhrase = this.$('#passPhrase').val();
|
|
this.setError('');
|
|
try {
|
|
await window.onLogin(passPhrase);
|
|
} catch (e) {
|
|
this.setError(`Error: ${e}`);
|
|
}
|
|
},
|
|
setError(string) {
|
|
this.$('.error').text(string);
|
|
},
|
|
});
|
|
|
|
})();
|