Commit 548180f1 authored by Eric Meier's avatar Eric Meier

minor fix

parent 31e3559b
......@@ -34,14 +34,14 @@ var addQuery = (query, userData) => {
.slice(0, 150);
};
var addAnalytic = (url, clicked, rating, userData) => {
var setAnalytic = (url, clicked, rating, userData) => {
if (!userData.recentQueries) userData.recentQueries = [];
let query = userData.recentQueries.find(q => q.url == url);
let suggestion = getSuggestionByUrl(url, userData);
if (!query) return;
query.clicked = clicked;
query.rating = rating;
if (!suggestion) return;
suggestion.clicked = clicked;
suggestion.rating = rating;
};
module.exports = {
......
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