mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
ITOTEAM-523 A app não redireciona as notificações
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user