Fixed bug preveting from importing a task that has no tag.

This commit is contained in:
Filip Makowski 2017-06-19 14:00:27 +02:00
parent 8362f1e9fc
commit d091ee9f0b
1 changed files with 14 additions and 15 deletions

View File

@ -302,22 +302,21 @@ QtObject {
tagsSeparated.splice(0, 1); // removing ""
if (tagsSeparated.length === 0) {
logIfVerbose("No tags");
return;
} else {
tagsSeparated.splice(0, 1); // removing headline
tagsSeparated.splice(0, 1); // removing "----"
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.forEach( function(tag){
var tagsRegexp = /[\s*]?(.+)[\s*]?1[\s*]?/i;
var fetchTag = tagsRegexp.exec(tag);
tagsPlainText += " +" + fetchTag[1].replace(/ /g,'');
});
}
tagsSeparated.splice(0, 1); // removing headline
tagsSeparated.splice(0, 1); // removing "----"
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.splice(tagsSeparated.length - 1, 1); // removing ""
tagsSeparated.forEach( function(tag){
var tagsRegexp = /[\s*]?(.+)[\s*]?1[\s*]?/i;
var fetchTag = tagsRegexp.exec(tag);
tagsPlainText += " +" + fetchTag[1].replace(/ /g,'');
});
}
var taskEntry = "* " + fetchTaskParams[2] + tagsPlainText;