From 9cf0849d96b4fde320ea01c4dc40c1fcb6ff5aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Jab=C5=82o=C5=84ski?= Date: Thu, 26 Jan 2017 08:40:36 +0100 Subject: [PATCH 1/2] Fix for missing user_metadata information in profile --- app/view/main/MainModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/view/main/MainModel.js b/app/view/main/MainModel.js index 8cfeb806..ca541bd1 100644 --- a/app/view/main/MainModel.js +++ b/app/view/main/MainModel.js @@ -8,6 +8,6 @@ Ext.define('Rambox.view.main.MainModel', { name: 'Rambox' ,username: localStorage.getItem('profile') ? JSON.parse(localStorage.getItem('profile')).name : '' ,avatar: localStorage.getItem('profile') ? JSON.parse(localStorage.getItem('profile')).picture : '' - ,last_sync: localStorage.getItem('profile') ? new Date(JSON.parse(localStorage.getItem('profile')).user_metadata.services_lastupdate).toUTCString() : '' + ,last_sync: localStorage.getItem('profile') && localStorage.getItem('profile').user_metadata ? new Date(JSON.parse(localStorage.getItem('profile')).user_metadata.services_lastupdate).toUTCString() : '' } }); From 1ef195f18a37d38859a7651d5ea95d69e99be995 Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Thu, 26 Jan 2017 12:00:08 -0300 Subject: [PATCH 2/2] Update MainModel.js --- app/view/main/MainModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/view/main/MainModel.js b/app/view/main/MainModel.js index ca541bd1..93dedde9 100644 --- a/app/view/main/MainModel.js +++ b/app/view/main/MainModel.js @@ -8,6 +8,6 @@ Ext.define('Rambox.view.main.MainModel', { name: 'Rambox' ,username: localStorage.getItem('profile') ? JSON.parse(localStorage.getItem('profile')).name : '' ,avatar: localStorage.getItem('profile') ? JSON.parse(localStorage.getItem('profile')).picture : '' - ,last_sync: localStorage.getItem('profile') && localStorage.getItem('profile').user_metadata ? new Date(JSON.parse(localStorage.getItem('profile')).user_metadata.services_lastupdate).toUTCString() : '' + ,last_sync: localStorage.getItem('profile') && JSON.parse(localStorage.getItem('profile')).user_metadata.services_lastupdate ? new Date(JSON.parse(localStorage.getItem('profile')).user_metadata.services_lastupdate).toUTCString() : '' } });