Open Closed

abp.notify feature #9245


1
OriAssurant created

Hi Abp Zero,

We are having Multi Page Application built with Asp.Net Core and Angular 8 and using abp.notify feature to display messages(set timeout to 5000 ms) throughout the website. When a message is displayed in one page and we route to a different page in less than 5000 ms, we are getting console error(below) and greyout page and unable to perform any action until page refresh. Please help us in handling this behavior and let us know if there is a possibility to close abp.notify messages before the timeout in ngOnDestroy() when switching between components.

Thanks.

ERROR TypeError: Cannot read property 'removeEventListener' of undefined at removePopupAndResetState (scripts.js:33343) at handlePopupAnimation (scripts.js:33417) at SweetAlert.close (scripts.js:33386) at dismissWith (scripts.js:34217) at scripts.js:34278 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:12578) at Object.onInvokeTask (vendor.js:71493) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (polyfills.js:12577) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (polyfills.js:12350) at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (polyfills.js:12653)


10 Answer(s)
  • 0
    maliming created
    Support Team

    hi

    I will check it. Thank you for your feedback.

  • 0
    maliming created
    Support Team

    hi

    You can try to upgrade sweetalert2. >= v8.14.0

    https://github.com/sweetalert2/sweetalert2/issues/1320

  • 0
    OriAssurant created

    Hi Maliming,

    I have tried upgrading Sweetalert2 to v8.14.0 and also the latest current version v9.15.1. But, still the problem exists.

  • 0
    maliming created
    Support Team

    hi @OriAssurant

    Can you share some code to reproduce your problem?

  • 0
    jtallon created

    We are experiencing the same issue now. Was there a resolution to this? It only happens some users. However for them the page is non responsive until the page is refreshed.

    link to GitHub which points here also: https://github.com/sweetalert2/sweetalert2/issues/1320

  • 0
    jtallon created

    I am using template version 9.0.1 - Perhaps the way I'm saving isn't correct.

    saveButtonClicked() {
    	const PerDto = this.getEditPerDto();
    	this.showMainSpinner('Saving...');
    	this._PersServiceProxy
    		.createOrEdit(PerDto)
    		.pipe(
    			finalize(() => {
    				this.hideMainSpinner();
    			})
    		)
    		.subscribe((PerId) => {
    			this.notify.success('Person saved succesfully');
    			if (this.isNewPer) {
    				this.router.navigate([`../${PerId}`], { relativeTo: this._activatedRoute });
    				return;
    			}
    			this.loadPerson(PerId);
    		});
    }
    

    I would appreciate feedback as this was something that wasn't noticed on my dev environment. I've updated sweetalert2 to version 10.10.0 on the offchance that the bug related to it - however I get the same result. Frozen UI until I refresh the browser.

  • 0
    ismcagdas created
    Support Team

    Hi @jtallon

    Could you create an issue on GitHub ? We can work on this in a short time.

    Thanks,

  • 0
    jtallon created

    Hi, I've commented on the github post: https://github.com/sweetalert2/sweetalert2/issues/1320

  • 0
    ismcagdas created
    Support Team

    Hi @jtallon,

    I have created the issue, please follow https://github.com/aspnetzero/aspnet-zero-core/issues/3610

  • 0
    ismcagdas created
    Support Team

    Hi @jtallon,

    I couldn't reproduce this issue. Normally this line https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/root-routing.module.ts#L26 should hide the visible swal element.

    Could you reproduce this on a empty 9.1 project and share it with info@aspnetzero.com ?

    Thanks,