1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

GitHub saver: Fix problem with saving to a non-existent directory

This commit is contained in:
Jermolene 2019-04-15 21:08:04 +01:00
parent 232eba2f7d
commit b32a5aa9af

View File

@ -56,16 +56,18 @@ GitHubSaver.prototype.save = function(text,method,callback) {
ref: branch
},
callback: function(err,getResponseDataJson,xhr) {
if(err) {
var getResponseData,sha = "";
if(err && xhr.status !== 404) {
return callback(err);
}
var getResponseData = JSON.parse(getResponseDataJson),
sha = "";
$tw.utils.each(getResponseData,function(details) {
if(details.name === filename) {
sha = details.sha;
}
});
if(xhr.status !== 404) {
getResponseData = JSON.parse(getResponseDataJson);
$tw.utils.each(getResponseData,function(details) {
if(details.name === filename) {
sha = details.sha;
}
});
}
var data = {
message: "Saved by TiddlyWiki",
content: base64utf8.base64.encode.call(base64utf8,text),