X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FUpsertUser.vue;h=c8df869a49fe6ca4390eaed9bfe04440d5bca3a2;hb=603b8a8b4a854efb168953da70e7b43ae99b50d9;hp=8d0b73695e03c92c4cd889d05c98a085fd1c4077;hpb=deca03e8aeb7cac9c19b0d43b4642b27299695b5;p=vchess.git diff --git a/client/src/components/UpsertUser.vue b/client/src/components/UpsertUser.vue index 8d0b7369..c8df869a 100644 --- a/client/src/components/UpsertUser.vue +++ b/client/src/components/UpsertUser.vue @@ -46,6 +46,20 @@ export default { enterTime: Number.MAX_SAFE_INTEGER, //for a basic anti-bot strategy }; }, + watch: { + nameOrEmail: function(newValue) { + if (newValue.indexOf('@') >= 0) + { + this.user.email = newValue; + this.user.name = ""; + } + else + { + this.user.name = newValue; + this.user.email = ""; + } + }, + }, computed: { submitMessage: function() { switch (this.stage) @@ -149,6 +163,8 @@ export default { this.user.name = ""; this.user.email = ""; this.user.notify = false; + delete localStorage["myid"]; + delete localStorage["myname"]; } ); },