sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 514 forks source link

A modalish stack that pushes to the top must use the close maxStrategy - migrated from v4 #404

Closed jitangupta closed 3 years ago

jitangupta commented 3 years ago

Getting A modalish stack that pushes to the top must use the close maxStrategy error on page load, using as Vanilla JS (ES5)

here is my code

  var notify_stack = new PNotify.Stack({
            'dir1': 'up',
        'dir2': 'left',
        'firstpos1': 25,
        'firstpos2': 25,
        'push': 'top'
        });

        PNotifyDesktop.permission();

        return new PNotify.notice({
            title: title,
            text: message,
            modules: new Map([
                ...PNotify.defaultModules,
                [PNotifyDesktop, {
                    type: type || "info",
                    addclass: "stack-bottomright",
                    stack: notify_stack,
                    icon: false,
                    styling: "fontawesome",
                }]
            ])
        });
jitangupta commented 3 years ago

the error comes when below lines execute multiple times.

var notify_stack = new PNotify.Stack({
        'dir1': 'up',
        'dir2': 'left',
        'firstpos1': 25,
        'firstpos2': 25,
        'push': 'top'
});