fix bug with universe switch

This commit is contained in:
2023-08-27 17:49:45 +02:00
parent 39377c7e96
commit 2b5bbdcd56

View File

@ -1,6 +1,5 @@
import { import {
uniqueNamesGenerator, uniqueNamesGenerator,
adjectives,
colors, colors,
animals, animals,
} from "unique-names-generator"; } from "unique-names-generator";
@ -629,7 +628,8 @@ export class Editor {
if (universeParam !== null) { if (universeParam !== null) {
new_universe = JSON.parse(atob(universeParam)); new_universe = JSON.parse(atob(universeParam));
const randomName: string = uniqueNamesGenerator({ const randomName: string = uniqueNamesGenerator({
dictionaries: [adjectives, colors, animals], length: 2, separator: '',
dictionaries: [colors, animals],
}); });
this.loadUniverse(randomName, new_universe["universe"]); this.loadUniverse(randomName, new_universe["universe"]);
this.emptyUrl(); this.emptyUrl();
@ -940,7 +940,6 @@ export class Editor {
// @ts-ignore // @ts-ignore
document.getElementById("buffer-search")!.value = ""; document.getElementById("buffer-search")!.value = "";
document.getElementById("editor")!.classList.remove("invisible"); document.getElementById("editor")!.classList.remove("invisible");
document.getElementById("modal")!.classList.add("invisible");
document.getElementById("modal-buffers")!.classList.add("invisible"); document.getElementById("modal-buffers")!.classList.add("invisible");
} }