X-Git-Url: https://git.auder.net/js/css/rpsls.css?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FHall.vue;h=091c71544e8d5fb5415ea7a536e17f35922308b1;hb=81dd17869116f70db375597b59232fa8cb11a868;hp=6d675a15bb08ddb6879178bf29533c5099f7b816;hpb=eb2d61de8d569470fa329a484efe9bab420b2b82;p=vchess.git diff --git a/client/src/views/Hall.vue b/client/src/views/Hall.vue index 6d675a15..091c7154 100644 --- a/client/src/views/Hall.vue +++ b/client/src/views/Hall.vue @@ -14,7 +14,7 @@ main p.text-center span.variantName | {{ curChallToAccept.vname }} - | {{ curChallToAccept.options.abridged }} + | {{ curChallToAccept.options.abridged || '' }} span {{ curChallToAccept.cadence }} span {{ st.tr["with"] + " " + curChallToAccept.from.name }} p.text-center(v-if="!!curChallToAccept.color") @@ -178,7 +178,7 @@ main ) td {{ pc.vname }} td {{ pc.cadence }} - td(:class="getRandomnessClass(pc)") {{ pc.options.abridged }} + td(:class="getRandomnessClass(pc)") {{ pc.options.abridged || '' }} td.remove-preset(@click="removePresetChall($event, pc)") img(src="/images/icons/delete.svg") .row @@ -300,6 +300,10 @@ export default { } }, created: function() { + // TODO: remove this patch soon: + this.presetChalls.forEach(pc => { + if (!pc.options) pc.options = { randomness: pc.randomness }; + }); document.addEventListener('visibilitychange', this.visibilityChange); window.addEventListener('focus', this.onFocus); window.addEventListener('blur', this.onBlur); @@ -475,7 +479,7 @@ export default { this.conn = null; }, getRandomnessClass: function(pc) { - if (!pc.options.randomness) return {}; + if (!Number.isInteger(pc.options.randomness)) return {}; return { ["random-" + pc.options.randomness]: true };