feat: add dashboard component (#811)

Fixes: #808
This commit is contained in:
Karan Takalkar
2020-05-30 22:15:29 +05:30
committed by GitHub
parent ca9404213c
commit ab3bef463d
27 changed files with 1025 additions and 13 deletions
+13
View File
@@ -99,6 +99,19 @@ export class WebAppComponent implements OnInit {
}
});
// Stores top 100 user activites as local storage object.
let activities: string[] = [];
if (localStorage.getItem('mifosXLocation')) {
const activitiesArray: string[] = JSON.parse(localStorage.getItem('mifosXLocation'));
const length = activitiesArray.length;
activities = length > 100 ? activitiesArray.slice(length - 100) : activitiesArray;
}
// Store route URLs array in local storage on navigation end.
onNavigationEnd.subscribe(() => {
activities.push(this.router.url);
localStorage.setItem('mifosXLocation', JSON.stringify(activities));
});
// Setup theme
const theme = this.themeStorageService.getTheme();
if (theme) {