mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
make error notification persistent, change text and make it translatable
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
"errorUpCase": "ERROR:",
|
||||
"newPassSent": "New password sent.",
|
||||
"serverUnreach": "Server currently unreachable.",
|
||||
"requestError": "Yikes, an error occurred! <strong>Please reload the page,</strong> your last action may not have been saved correctly.",
|
||||
"seeConsole": "If the error persists, please report it at Help > Report a Bug. If you're familiar with your browser's console, please include any error messages.",
|
||||
"error": "Error",
|
||||
"menu": "Menu",
|
||||
|
||||
@@ -35,9 +35,9 @@ angular.module('habitrpg').config(['$httpProvider', function($httpProvider){
|
||||
|
||||
// Error
|
||||
} else {
|
||||
var error = '<strong>Please reload</strong>, ' +
|
||||
'"'+window.env.t('error')+' '+(response.data.err || response.data || 'something went wrong')+'" ' +
|
||||
window.env.t('seeConsole');
|
||||
var error = window.env.t('requestError') + '<br><br>"' +
|
||||
window.env.t('error') + ' ' + (response.data.err || response.data || 'something went wrong') +
|
||||
'" <br><br>' + window.env.t('seeConsole');
|
||||
if (mobileApp) error = 'Error contacting the server. Please try again in a few minutes.';
|
||||
$rootScope.$broadcast('responseError', error);
|
||||
console.error(response);
|
||||
|
||||
@@ -108,13 +108,14 @@ angular.module("habitrpg").factory("Notification",
|
||||
var stack_topright = {"dir1": "down", "dir2": "left", "spacing1": 15, "spacing2": 15, "firstpos1": 60};
|
||||
|
||||
function _notify(html, type, icon) {
|
||||
console.log(type)
|
||||
var notice = $.pnotify({
|
||||
type: type || 'warning', //('info', 'text', 'warning', 'success', 'gp', 'xp', 'hp', 'lvl', 'death', 'mp', 'crit')
|
||||
text: html,
|
||||
opacity: 1,
|
||||
addclass: 'alert-' + type,
|
||||
delay: 7000,
|
||||
hide: (type == 'error') ? false : true,
|
||||
hide: (type == 'error' || type == 'danger') ? false : true,
|
||||
mouse_reset: false,
|
||||
width: "250px",
|
||||
stack: stack_topright,
|
||||
|
||||
Reference in New Issue
Block a user