Zotero.PreferencePanes: Fix shutdown observer error (#2845)

`this` referred to the observer instead of Zotero.PreferencePanes, so
`this.pluginPanes.length` caused an error and plugin panes were not removed.
This commit is contained in:
Abe Jellinek 2022-10-05 13:00:19 -04:00 committed by Dan Stillman
parent ccc94e7b45
commit 93666d310e

View file

@ -162,7 +162,7 @@ Zotero.PreferencePanes = {
}
Zotero.Plugins.addObserver({
shutdown({ id: pluginID }) {
shutdown: ({ id: pluginID }) => {
let beforeLength = this.pluginPanes.length;
this.pluginPanes = this.pluginPanes.filter(pane => pane.pluginID !== pluginID);
if (this.pluginPanes.length !== beforeLength) {