jlegewie / zotfile

Zotero plugin to manage your attachments: automatically rename, move, and attach PDFs (or other files) to Zotero items, sync PDFs from your Zotero library to your (mobile) PDF reader (e.g. an iPad, Android tablet, etc.), and extract PDF annotations.
4.05k stars 282 forks source link

Fix the open Preference issue on MacOS #595

Open yhmtsai opened 2 years ago

yhmtsai commented 2 years ago

This PR fixes the NS_ERROR_NOT_AVAILABLE issue from https://github.com/jlegewie/zotfile/issues/581 MacOS can use Command + W to close Zotero Window but not close the Zotero. Then MacOS can open Zotero again which redraw ZoteroPane. However, Zotfile is already existed, so it will not be recreated. the window variable inside Zotfile now point to the old window not current one. always get the main window such that Zotfile can still open Preference when MacOS reopen Zotero.