Skip to content

Commit

Permalink
fix: syrinscape not initialized if player is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
scooper4711 committed Jul 10, 2024
1 parent 304e04d commit d53be92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/SyrinscapePlayerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ export class SyrinscapePlayerView extends ItemView {
* and after onOpen has been called.
*/
async activateSyrinscape() {
console.log('Syrinscape - Activating Syrinscape player.');
await syrinscape.config.init()
if (!syrinscape?.player?.syncSystem?.events) {
console.error('Syrinscape - activateSyrinscape called before syrinscape.player.syncSystem.events is available.');
return;
Expand Down
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default class SyrinscapePlugin extends Plugin {
// "Reveal" the leaf in case it is in a collapsed sidebar
workspace.revealLeaf(leaf);
}
console.debug("Syrinscape - leaf:", leaf);
}
}

Expand Down Expand Up @@ -176,7 +175,11 @@ export default class SyrinscapePlugin extends Plugin {
.catch(error => console.error("Error loading script:", error));

this.loadExternalScript("https://syrinscape.com/visualisation.js")
.then(() => console.debug("Script loaded successfully."))
.then(() => {
console.debug("Script loaded successfully.");
console.log('Syrinscape - Activating Syrinscape player.');
syrinscape.config.init()
})
.catch(error => console.error("Error loading script:", error));
}
/**
Expand Down

0 comments on commit d53be92

Please sign in to comment.