Store chat username on send

This commit is contained in:
Gabe Kangas
2020-06-02 10:38:13 -07:00
parent 4cb282040b
commit 94fabf56a8
3 changed files with 7 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ define(
this.author = ko.observable(model.author);
this.body = ko.observable(model.body);
} else {
this.author = ko.observable("Anonymous");
const storedAuthor = localStorage.author || "Viewer" + (Math.floor(Math.random() * 42) + 1)
this.author = ko.observable(storedAuthor);
this.body = ko.observable("");
}
this.image = ko.observable("https://robohash.org/" + this.author() + "?set=set3&size=50x50")