Skip to content

Commit

Permalink
Fixed issue with blank name - micro.blog
Browse files Browse the repository at this point in the history
  • Loading branch information
am1t committed Aug 5, 2018
1 parent bd64512 commit a8819d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const getFileName = function (doc) {
} else if(typeof doc.properties["mp-slug"] !== 'undefined' && doc.properties["mp-slug"]) {
return Promise.resolve("" + doc.properties["mp-slug"]);
} else {
if(typeof doc.properties.name !== 'undefined' && doc.properties.name && doc.properties.name !== ""){
if(typeof doc.properties.name !== 'undefined' && doc.properties.name && doc.properties.name[0] !== ""){
return Promise.resolve(kebabCase(doc.properties.name[0].trim()));
} else {
return Promise.resolve("" + Date.now());
Expand All @@ -28,7 +28,7 @@ const getFileName = function (doc) {
};

const getFilePath = function (doc) {
if(doc.properties.name !== undefined && doc.properties.name !== ""){
if(doc.properties.name !== undefined && doc.properties.name[0] !== ""){
return Promise.resolve(config.post_path);
} else {
return Promise.resolve(config.micro_post_path);
Expand Down

0 comments on commit a8819d1

Please sign in to comment.