Default to My Library if pane not yet open saving snapshot from connector

This commit is contained in:
Dan Stillman 2016-05-20 16:22:28 -04:00
parent 0be2796500
commit f5812852cb

View file

@ -412,15 +412,17 @@ Zotero.Server.Connector.SaveSnapshot.prototype = {
"init":function(url, data, sendResponseCallback) {
Zotero.Server.Connector.Data[data["url"]] = "<html>"+data["html"]+"</html>";
// figure out where to save
var libraryID = null;
var collectionID = null;
var zp = Zotero.getActiveZoteroPane();
try {
var libraryID = zp.getSelectedLibraryID();
var collection = zp.getSelectedCollection();
} catch(e) {}
// Default to personal library if pane not yet opened
if (!libraryID) {
libraryID = Zotero.Libraries.userLibraryID
}
// determine whether snapshot can be saved
var filesEditable;
if (libraryID) {