@sgcloud-sgsistemas/base 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -193,16 +193,33 @@ const controller = function ($scope, $timeout, mbUserService, $state) {
|
|
|
193
193
|
mbUserService.setComponentCallback((user) => { $scope.user = user; });
|
|
194
194
|
mbUserService.setUser(this.config);
|
|
195
195
|
$scope.user = mbUserService.getUser();
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
{title: 'Nome fantasia', text: $scope.currentCompany.nickname}
|
|
202
|
-
] }
|
|
203
|
-
|
|
196
|
+
if (JSON.parse(localStorage.getItem('currentCompany'))) {
|
|
197
|
+
$scope.setCompanyInfo()
|
|
198
|
+
} else {
|
|
199
|
+
$scope.setCompanyInfoRecursive()
|
|
200
|
+
}
|
|
204
201
|
$scope.focusCompany()
|
|
205
202
|
};
|
|
203
|
+
|
|
204
|
+
$scope.setCompanyInfoRecursive = () => {
|
|
205
|
+
$timeout(() => {
|
|
206
|
+
if (JSON.parse(localStorage.getItem('currentCompany'))) {
|
|
207
|
+
$scope.setCompanyInfo()
|
|
208
|
+
} else {
|
|
209
|
+
$scope.setCompanyInfoRecursive()
|
|
210
|
+
}
|
|
211
|
+
}, 1000);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
$scope.setCompanyInfo = () => {
|
|
215
|
+
$scope.currentCompany = JSON.parse(localStorage.getItem('currentCompany')).data
|
|
216
|
+
$scope.menu = {info:[
|
|
217
|
+
{title: 'Usuario', text: $scope.user.name},
|
|
218
|
+
{title: 'Nome abreviado', text: $scope.currentCompany.shortName},
|
|
219
|
+
{title: 'Razão social', text: $scope.currentCompany.name},
|
|
220
|
+
{title: 'Nome fantasia', text: $scope.currentCompany.nickname}
|
|
221
|
+
] }
|
|
222
|
+
}
|
|
206
223
|
};
|
|
207
224
|
|
|
208
225
|
export default controller;
|