Commit d0a57dca authored by Eric Meier's avatar Eric Meier

fixes ...

parent 4b102aef
var request = require("sync-request"); var request = require("sync-request");
//const HOST = "https://evil-octopus-34.localtunnel.me/"; //const HOST = "https://evil-octopus-34.localtunnel.me/";
const HOST = "https://suggestions32435342.localtunnel.me"; const HOST = "https://suggestions32435342.localtunnel.me/";
var querySuggestions = (keyword, read_time, difficulty) => { var querySuggestions = (keyword, read_time, difficulty) => {
var url = `${HOST}suggestions?keyword=${normalize( var url = `${HOST}suggestions?keyword=${normalize(
...@@ -24,8 +24,9 @@ var querySuggestions = (keyword, read_time, difficulty) => { ...@@ -24,8 +24,9 @@ var querySuggestions = (keyword, read_time, difficulty) => {
return data; return data;
}; };
var normalize = string => { var normalize = s => {
string.replace(" ", "-"); while (s.includes(" ")) s = s.replace(" ", "-");
return s;
}; };
var fetchJsonSync = url => { var fetchJsonSync = url => {
......
...@@ -64,7 +64,7 @@ module.exports = [ ...@@ -64,7 +64,7 @@ module.exports = [
session.dialogData.skillLevel session.dialogData.skillLevel
); );
suggestionStore.addHistory(suggestions); //suggestionStore.addHistory(suggestions);
session.replaceDialog("suggestions", suggestions); session.replaceDialog("suggestions", suggestions);
next(); next();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment