♻️ PMGR: Reuse notification
So far we were constantly removing and recreating a notification on each plugin manager log event. We now only create the notification once and then reuse/update it. Potentially related to #3729
This commit is contained in:
1 parent
ec4e2c7193
commit
80f2ab86c1
2 files changed
+25
-10
No files matched your search
@@ -992,19 +992,25 @@ $(function() {
|
||||
var options = {
|
||||
title: title,
|
||||
text: text,
|
||||
type: type
|
||||
type: type,
|
||||
hide: false
|
||||
};
|
||||
|
||||
if (self.logNotification !== undefined) {
|
||||
self.logNotification.remove();
|
||||
}
|
||||
|
||||
if (confirm !== undefined) {
|
||||
options.confirm = confirm;
|
||||
options.hide = false;
|
||||
self.logNotification = PNotify.singleButtonNotify(options);
|
||||
|
||||
if (self.logNotification === undefined) {
|
||||
self.logNotification = PNotify.singleButtonNotify(options);
|
||||
} else {
|
||||
self.logNotification.update(options);
|
||||
self.logNotification = PNotify.fixSingleButton(self.logNotification, options);
|
||||
}
|
||||
} else {
|
||||
self.logNotification = new PNotify(options);
|
||||
if (self.logNotification === undefined) {
|
||||
self.logNotification = new PNotify(options);
|
||||
} else {
|
||||
self.logNotification.update(options);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user