Cleanup bug reporter button

This commit is contained in:
Tankred Hase 2014-08-12 18:32:37 +02:00
parent 275a602274
commit 0e21616911
9 changed files with 11 additions and 22 deletions

View File

@ -89,7 +89,6 @@ define(function(require) {
message: message,
positiveBtnStr: str.updatePublicKeyPosBtn,
negativeBtnStr: str.updatePublicKeyNegBtn,
showBugReporter: false,
showNegativeBtn: true,
callback: callback
});

View File

@ -65,7 +65,6 @@ define(function(require) {
$scope.state.account.toggle(false);
$scope.$apply();
$scope.onError({
showBugReporter: false,
title: 'Success',
message: 'Exported keypair to file.'
});

View File

@ -25,7 +25,6 @@ define(function(require) {
$scope.importKey = function() {
if (!$scope.state.agree) {
$scope.onError({
showBugReporter: false,
message: termsMsg
});
return;
@ -43,7 +42,6 @@ define(function(require) {
$scope.setPassphrase = function() {
if (!$scope.state.agree) {
$scope.onError({
showBugReporter: false,
message: termsMsg
});
return;

View File

@ -32,10 +32,7 @@ define(function(require) {
$scope.verifyRecoveryToken = function(callback) {
if (!$scope.recoveryToken) {
$scope.onError({
message: 'Please set the recovery token!',
showBugReporter: false
});
$scope.onError(new Error('Please set the recovery token!'));
return;
}
@ -68,10 +65,7 @@ define(function(require) {
var inputCode = '' + $scope.code0 + $scope.code1 + $scope.code2 + $scope.code3 + $scope.code4 + $scope.code5;
if (!inputCode) {
$scope.onError({
message: 'Please enter the keychain code!',
showBugReporter: false
});
$scope.onError(new Error('Please enter the keychain code!'));
return;
}

View File

@ -27,8 +27,7 @@ define(function(require) {
// show message
$scope.onError({
title: 'Info',
message: 'Your PGP key has already been synced.',
showBugReporter: false
message: 'Your PGP key has already been synced.'
});
return;
}
@ -182,8 +181,7 @@ define(function(require) {
// show success message
$scope.onError({
title: 'Success',
message: 'Whiteout Keychain setup successful!',
showBugReporter: false
message: 'Whiteout Keychain setup successful!'
});
});
});

View File

@ -48,6 +48,7 @@ define(function(require) {
function onPassphraseChanged(err, newPrivateKeyArmored) {
if (err) {
err.showBugReporter = false;
$scope.onError(err);
return;
}
@ -74,8 +75,7 @@ define(function(require) {
$scope.$apply();
$scope.onError({
title: 'Success',
message: 'Passphrase change complete.',
showBugReporter: false
message: 'Passphrase change complete.'
});
}
};

View File

@ -21,7 +21,7 @@ define(function(require) {
positiveBtnStr: options.positiveBtnStr || 'Ok',
negativeBtnStr: options.negativeBtnStr || 'Cancel',
showNegativeBtn: options.showNegativeBtn || false,
showBugReporter: (typeof options.showBugReporter !== 'undefined' ? options.showBugReporter : true),
showBugReporter: (typeof options.showBugReporter !== 'undefined' ? options.showBugReporter : !options.title), // if title is set, presume it's not an error by default
callback: options.callback
};
// don't call apply for synchronous calls

View File

@ -6,7 +6,7 @@
<li class="google enabled" popover="#google-info" wo-touch="connectToGoogle()">
<div><img src="img/google_logo.png" alt="Google Mail"></div>
</li>
<li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true, showBugReporter:false})">
<li class="whiteout disabled" popover="#whiteout-info" wo-touch="onError({message:'Whiteout Mailbox coming soon!', sync:true})">
<div><img src="img/whiteout_logo.svg" alt="Whiteout Mailbox"></div>
</li>
<li class="tonline" popover="#tonline-info" wo-touch="connectToTonline()">

View File

@ -7,9 +7,10 @@
<div class="content">
<p>{{state.dialog.message}} <a ng-show="state.dialog.faqLink" href="{{state.dialog.faqLink}}" target="_blank">Learn more</a></p>
<div class="control">
<button wo-touch="confirm(true); state.writer.reportBug()" class="btn btn-alt" ng-show="state.writer && state.dialog.showBugReporter">Report this bug</button><!-- only show if we can actually report a bug, i.e. the writer is attached to the scope -->
<button wo-touch="confirm(false)" class="btn btn-alt" ng-show="state.dialog.showNegativeBtn">{{state.dialog.negativeBtnStr}}</button>
<button wo-touch="confirm(true)" class="btn">{{state.dialog.positiveBtnStr}}</button>
<!-- only show bug report button if we can actually report a bug, i.e. the writer is attached to the scope -->
<button wo-touch="confirm(true)" class="btn" ng-show="!state.writer || !state.dialog.showBugReporter">{{state.dialog.positiveBtnStr}}</button>
<button wo-touch="confirm(true); state.writer.reportBug()" class="btn" ng-show="state.writer && state.dialog.showBugReporter">Report bug</button>
</div>
</div><!-- /.content -->
</div><!-- /.lightbox-body -->