From f49f0424d583b038f55d5bed51c9778fd4bc766f Mon Sep 17 00:00:00 2001 From: Riandy Rahman Nugraha Date: Sat, 5 Aug 2017 16:59:56 +0700 Subject: [PATCH] generalized to_tag() into to_tags() --- index.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 8180d375..4376907e 100644 --- a/index.html +++ b/index.html @@ -117,9 +117,13 @@ } // Construct a user discovery tag - function to_tag(tagname, value) { - if (tagname && value) { - return [tagname + ":" + value]; + function to_tags(tagsObj) { + if(tagsObj && Object.keys(tagsObj).length > 0) { + var tags = []; + for(var key in tagsObj) { + tags.push(key + ":" + tagsObj[key]); + } + return tags; } return undefined; } @@ -693,7 +697,7 @@ this.state.password.trim(), vcard(this.state.fn, this.state.imageDataUrl), null, - to_tag("email", this.state.email)); + to_tags({"email": this.state.email})); } }, render: function() {