another test
This commit is contained in:
15
src/main.ts
15
src/main.ts
@ -579,11 +579,12 @@ export class Editor {
|
|||||||
const universeParam = url.get("universe");
|
const universeParam = url.get("universe");
|
||||||
if (universeParam !== null) {
|
if (universeParam !== null) {
|
||||||
new_universe = JSON.parse(universeParam);
|
new_universe = JSON.parse(universeParam);
|
||||||
|
this.loadUniverse("imported", new_universe["universe"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.settings.universes["imported"] = new_universe;
|
|
||||||
this.loadUniverse("imported", false, new_universe);
|
|
||||||
}
|
}
|
||||||
|
console.log(this.universes[this.selected_universe]);
|
||||||
|
console.log(this.universes["imported"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
get note_buffer() {
|
get note_buffer() {
|
||||||
@ -820,19 +821,15 @@ export class Editor {
|
|||||||
*/
|
*/
|
||||||
loadUniverse(
|
loadUniverse(
|
||||||
universeName: string,
|
universeName: string,
|
||||||
saving: boolean = true,
|
|
||||||
universe: Universe = template_universe
|
universe: Universe = template_universe
|
||||||
): void {
|
): void {
|
||||||
console.log(universeName, saving, universe);
|
console.log(universeName, universe);
|
||||||
|
this.currentFile().candidate = this.view.state.doc.toString();
|
||||||
if (saving) {
|
|
||||||
// Saving the current file before initiating the switch logic
|
|
||||||
this.currentFile().candidate = this.view.state.doc.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Getting the new universe name and moving on
|
// Getting the new universe name and moving on
|
||||||
let selectedUniverse = universeName.trim();
|
let selectedUniverse = universeName.trim();
|
||||||
if (this.universes[selectedUniverse] === undefined) {
|
if (this.universes[selectedUniverse] === undefined) {
|
||||||
|
this.settings.universes[selectedUniverse] = universe;
|
||||||
this.universes[selectedUniverse] = universe;
|
this.universes[selectedUniverse] = universe;
|
||||||
}
|
}
|
||||||
this.selected_universe = selectedUniverse;
|
this.selected_universe = selectedUniverse;
|
||||||
|
|||||||
Reference in New Issue
Block a user