Internal - Fix js errors

pull/3464/head
Julio Montoya 5 years ago
parent 81d51deda0
commit 9111eb0d9e
  1. 12
      assets/vue/App.vue
  2. 4
      assets/vue/mixins/NotificationMixin.js
  3. 8
      public/main/inc/lib/display.lib.php

@ -130,11 +130,19 @@ export default {
},
created() {
this.$data.legacy_content = '';
// section-content
let isAuthenticated = JSON.parse(this.$parent.$el.attributes["data-is-authenticated"].value),
let isAuthenticated = false;
if (this.$parent.$el.attributes["data-is-authenticated"].value) {
isAuthenticated = JSON.parse(this.$parent.$el.attributes["data-is-authenticated"].value);
}
let user = null;
if (this.$parent.$el.attributes["data-user-json"].value) {
user = JSON.parse(this.$parent.$el.attributes["data-user-json"].value);
}
let payload = {isAuthenticated: isAuthenticated, user: user};
this.$store.dispatch("security/onRefresh", payload);
if (this.$parent.$el.attributes["data-flashes"]) {
let flashes = JSON.parse(this.$parent.$el.attributes["data-flashes"].value);

@ -32,6 +32,10 @@ export default {
}
};
if ('danger' === type) {
type = 'error';
}
this.$toast(content, {
type: type,
position: 'top-center',

@ -469,11 +469,8 @@ class Display
*
* @return string Message wrapped into an HTML div
*/
public static function return_message(
$message,
$type = 'normal',
$filter = true
) {
public static function return_message($message, $type = 'normal', $filter = true)
{
if (empty($message)) {
return '';
}
@ -500,6 +497,7 @@ class Display
$class .= 'alert alert-success';
break;
case 'normal':
case 'info':
default:
$class .= 'alert alert-info';
}

Loading…
Cancel
Save