mirror of
https://github.com/zotero/zotero.git
synced 2026-10-06 02:50:03 +00:00
Fix the window lookup for OS keystore alerts
'zotero:main' isn't a registered window type, so the lookup always returned null and the alerts were never shown. https://forums.zotero.org/discussion/133418/
This commit is contained in:
parent
bccaf46ff2
commit
d276ec19c5
1 changed files with 9 additions and 2 deletions
|
|
@ -56,9 +56,16 @@ Zotero.OSKeyStore = {
|
|||
return typeof value == 'string' && value.startsWith(this._prefix);
|
||||
},
|
||||
|
||||
// The settings window, where credentials are usually saved from, or the main window when
|
||||
// they're saved during a sync
|
||||
_getParentWindow: function () {
|
||||
return Services.wm.getMostRecentWindow('zotero:pref')
|
||||
|| Services.wm.getMostRecentWindow('navigator:browser');
|
||||
},
|
||||
|
||||
// Show an alert when an active write of new credentials fails (e.g., keychain unavailable)
|
||||
alertSaveFailed: function () {
|
||||
let win = Services.wm.getMostRecentWindow('zotero:main');
|
||||
let win = this._getParentWindow();
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -78,7 +85,7 @@ Zotero.OSKeyStore = {
|
|||
return;
|
||||
}
|
||||
this._migrateAlertShown = true;
|
||||
let win = Services.wm.getMostRecentWindow('zotero:main');
|
||||
let win = this._getParentWindow();
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue