1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

misc fixes

This commit is contained in:
Kyle Spearrin 2017-07-12 13:38:06 -04:00
parent 13fbfc43f9
commit 81ad214f2f
6 changed files with 33 additions and 14 deletions

View File

@ -751,7 +751,7 @@
"message": "Select a file.",
"description": "Select a file."
},
"fileTooLarge": {
"maxFileSize": {
"message": "Maximum file size is 100 MB.",
"description": "Maximum file size is 100 MB."
}

View File

@ -80,7 +80,9 @@
cancelButtonText: i18nService.cancel
}, function (confirmed) {
$analytics.eventTrack('Clicked Change Password');
alertCallback(confirmed);
if (confirmed) {
chrome.tabs.create({ url: 'https://help.bitwarden.com/article/change-your-master-password/' });
}
});
};
@ -93,7 +95,9 @@
cancelButtonText: i18nService.cancel
}, function (confirmed) {
$analytics.eventTrack('Clicked Change Email');
alertCallback(confirmed);
if (confirmed) {
chrome.tabs.create({ url: 'https://help.bitwarden.com/article/change-your-email/' });
}
});
};
@ -106,16 +110,12 @@
cancelButtonText: i18nService.cancel
}, function (confirmed) {
$analytics.eventTrack('Clicked Two-step Login');
alertCallback(confirmed);
if (confirmed) {
chrome.tabs.create({ url: 'https://help.bitwarden.com/article/setup-two-step-login/' });
}
});
};
function alertCallback(confirmed) {
if (confirmed) {
chrome.tabs.create({ url: 'https://vault.bitwarden.com' });
}
}
$scope.rate = function () {
$analytics.eventTrack('Rate Extension');

View File

@ -28,7 +28,7 @@
}, function (confirmed) {
if (confirmed) {
$analytics.eventTrack('Launch Web Vault For Import');
chrome.tabs.create({ url: 'https://vault.bitwarden.com' });
chrome.tabs.create({ url: 'https://help.bitwarden.com/article/import-data/' });
}
});
};

View File

@ -21,7 +21,7 @@ angular
}
if (files[0].size > 104857600) { // 100 MB
toastr.error(i18nService.fileTooLarge, i18nService.errorsOccurred);
toastr.error(i18nService.maxFileSize, i18nService.errorsOccurred);
return deferred.promise;
}

View File

@ -37,6 +37,9 @@
<input type="file" id="file" name="file" />
</div>
</div>
<div class="list-section-footer">
{{i18n.maxFileSize}}
</div>
</div>
</div>
</div>

View File

@ -383,7 +383,7 @@ function initLoginService() {
});
},
function (response) {
handleError(response, deferred);
handleErrorMessage(response, deferred);
});
});
};
@ -435,7 +435,7 @@ function initLoginService() {
deferred.resolve();
});
}, function (response) {
handleError(response, deferred);
handleErrorMessage(response, deferred);
});
return deferred.promise;
@ -444,4 +444,20 @@ function initLoginService() {
function handleError(error, deferred) {
deferred.reject(error);
}
function handleErrorMessage(error, deferred) {
if (error.validationErrors) {
for (var key in error.validationErrors) {
if (!error.validationErrors.hasOwnProperty(key)) {
continue;
}
if (error.validationErrors[key].length) {
deferred.reject(error.validationErrors[key][0]);
return;
}
}
}
deferred.reject(error.message);
return;
}
};