- if (elt.previousElementSibling)
- elt.previousElementSibling.classList.remove("active");
- else elt.nextElementSibling.classList.remove("active");
+ for (let t of ["live","corr","import"]) {
+ if (t != type)
+ document.getElementById(t + "Games").classList.remove("active");
+ }
+ },
+ addGameImport(game) {
+ game.type = "import";
+ ImportgameStorage.add(game, (err) => {
+ if (!!err) {
+ if (err.message.indexOf("Key already exists") < 0) {
+ alert(this.st.tr["An error occurred. Try again!"]);
+ return;
+ }
+ // NOTE: since a random new ID is generated for imported games,
+ // this error will not occur.
+ else alert(this.st.tr["The game was already imported"]);
+ }
+ this.$router.push("/game/" + game.id);
+ });