ITOTEAM-523 A app não redireciona as notificações

This commit is contained in:
Peter Maquiran
2024-06-25 12:11:44 +01:00
parent 76ff62d428
commit fbaf0afcf1
14 changed files with 231 additions and 186 deletions
+19 -2
View File
@@ -57,6 +57,23 @@ export class ToastService {
}
removeBeforeHash(text) {
const hashIndex = text.indexOf('#');
if (hashIndex !== -1) {
return text.substring(hashIndex);
}
return text;
}
getEverythingBeforeHash(text) {
const hashIndex = text.indexOf('#');
if (hashIndex !== -1) {
return text.substring(0, hashIndex).trim();
}
return text;
}
async _badRequest(message?: string, callback?) {
let notification = document.createElement('div')
@@ -73,9 +90,9 @@ export class ToastService {
`
notification.style.animationName = 'notification-top'
console.error(this.removeBeforeHash(message))
document.body.append(notification)
notification.querySelector('.text').innerHTML = message || 'Processo não efetuado'
notification.querySelector('.text').innerHTML = this.getEverythingBeforeHash(message) || 'Processo não efetuado'
setTimeout(()=>{
if (callback) {
callback()