feat: warn, if connection to server is lost

This commit is contained in:
Settel 2022-03-15 08:06:20 +01:00
parent 0d3661a4bc
commit d46c51b35c

View File

@ -15,6 +15,10 @@
<Final v-if="gameState === 'final'" />
</div>
</div>
<div v-if="connectionLost" class="page-play__error-box">
<div>connection to server lost</div>
<button @click="reload">reload</button>
</div>
<div v-if="showDebugPanel" class="page-play__container-debug">
<EngineDebug />
</div>
@ -40,6 +44,14 @@ export default {
gamePhase() {
return this.$store.state.game.phase
},
connectionLost() {
return this.$store.state.engine.version == -1
},
},
methods: {
reload() {
window.location.reload()
},
},
}
</script>
@ -80,5 +92,21 @@ export default {
font-size: 24px;
color: #ffffff;
}
&__error-box {
position: absolute;
left: 30%;
top: 10%;
width: 40%;
height: 5em;
padding: 1em;
border: 1px solid #ffffff;
border-radius: 20px;
background-color: #804040;
color: #ffffff;
text-align: center;
button {
margin: 1em;
}
}
}
</style>