refactor: notification last longer
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
40% {
|
40% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
80% {
|
70% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
@@ -22,13 +22,13 @@
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.5);
|
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.5);
|
||||||
padding: 1rem 3rem;
|
padding: 1rem 3rem;
|
||||||
position: absolute;
|
position: fixed;
|
||||||
right: 1rem;
|
right: 1rem;
|
||||||
top: 1rem;
|
top: 1rem;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
|
||||||
&--fade-in-out {
|
&--fade-in-out {
|
||||||
animation: fade-in-out 0.8s ease-in-out forwards;
|
animation: fade-in-out ease-in-out 1s forwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--success {
|
&--success {
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ describe('Notifier', () => {
|
|||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set notification on notify and clean it after 800ms', fakeAsync(() => {
|
it('should set notification on notify and clean it after 1100ms', fakeAsync(() => {
|
||||||
TestBed.tick();
|
TestBed.tick();
|
||||||
const NOTIFICATION_MOCK = new Notification('MOCK NOTIFICATION');
|
const NOTIFICATION_MOCK = new Notification('MOCK NOTIFICATION');
|
||||||
service.notify(NOTIFICATION_MOCK);
|
service.notify(NOTIFICATION_MOCK);
|
||||||
expect(service.notification$()).toEqual(NOTIFICATION_MOCK);
|
expect(service.notification$()).toEqual(NOTIFICATION_MOCK);
|
||||||
TestBed.tick();
|
TestBed.tick();
|
||||||
tick(1000);
|
tick(1100);
|
||||||
expect(service.notification$()).toEqual(null);
|
expect(service.notification$()).toEqual(null);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class Notifier {
|
|||||||
if (this.notification$()) {
|
if (this.notification$()) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.cleanup();
|
this.cleanup();
|
||||||
}, 800);
|
}, 1100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user