Skip to content

Commit

Permalink
Update dittytoyJukebox.js
Browse files Browse the repository at this point in the history
  • Loading branch information
reindernijhoff committed Mar 20, 2024
1 parent 74c9d11 commit 795f40c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/src/dittytoyJukebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export default class DittytoyJukebox {

this.fetchDitties();

const urlParams = new URLSearchParams(window.location.search);
const dittyId = urlParams.get('ditty') || '24373308b4';
const dittyId = window.location.hash?.slice(1) || '24373308b4';
this.fetchDitty(dittyId);

$('play-button').addEventListener('click', async () => {
Expand Down Expand Up @@ -68,6 +67,8 @@ export default class DittytoyJukebox {
});

await this.dittytoy.compile(this.ditty.code);

window.location.hash = `${id}`;
}

async pause() {
Expand Down

0 comments on commit 795f40c

Please sign in to comment.