Code refactoring

This commit is contained in:
Eudes Inácio
2021-08-30 14:55:24 +01:00
parent 81b7f4820b
commit 133b832f9b
4 changed files with 24 additions and 23 deletions
+6 -14
View File
@@ -69,9 +69,12 @@ export class ProfilePage implements OnInit {
this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
var data = JSON.parse(value);
console.log("Init store parse", data)
data.forEach((element,i) => {
/* var data = JSON.parse(value); */
console.log("Init store parse", value)
if(typeof(value) == 'string') {
value = JSON.stringify(value)
}
value.forEach((element,i) => {
console.log("ARaaAA", element)
let notificationObject;
if(element.payload){
@@ -121,17 +124,6 @@ export class ProfilePage implements OnInit {
console.log('Timer badge count')
}
typeAgendaColor(service,typeagenda,role){
if (service == "agenda" && typeagenda == "oficial" && role == "100000011"){
document.body.style.setProperty(`--notificationtypeagenda`, "#ffb703");
} else if( service == "agenda" && typeagenda == "pessoal" && role == "100000011"){
document.body.style.setProperty(`--notificationtypeagenda`, "#ff0303");
} else if (service == "agenda" && typeagenda == "oficial" && role == "100000014"){
document.body.style.setProperty(`--notificationtypeagenda`, "#03d838");
} else if (service == "agenda" && typeagenda == "oficial" && role == "100000014"){
document.body.style.setProperty(`--notificationtypeagenda`, "#8b0ae0");
}
}
getFormatedTime(dateString){
var date = new Date(dateString);