Finished functionality of autocomplete.
Autocomplete could use some input on what to do when certain buttons
are pressed.
Change-Id: I1b4a9f2e8e7f9526e6d14cfb443e56676ae45576
diff --git a/client/query/query.js b/client/query/query.js
index af01a58..3993c43 100644
--- a/client/query/query.js
+++ b/client/query/query.js
@@ -201,6 +201,14 @@
scope.face.expressInterest(new Interest(name).setInterestLifetimeMilliseconds(5000),
function(interest, data){
console.log("Autocomplete query return: ", data.getContent().toString());
+
+ if (data.getContent().length !== 0){
+ var options = JSON.parse(data.getContent().toString().replace(/[\n\0]/g, "")).next.map(function(element){
+ return field + element;
+ });
+ callback(options);
+ }
+
}, function(interest){
console.warn("Interest timed out!", interest);
});