Skip to content

Commit

Permalink
Fix: debug mode not working after adding the option to mute
Browse files Browse the repository at this point in the history
Ref. 0aa6470
  • Loading branch information
igrep committed Apr 27, 2024
1 parent b3cb6e4 commit 4c0ec18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ chrome.runtime.onMessage.addListener(function(message) {
mainOrDebug = () => {
const blocks = getBlocks()
visualizeBlocks(blocks)
main({withScoreboard : false, initialBallSpeed : "middle"})
main({
...message.options,
withScoreboard : false
})
dragAndMoveBall(blocks)
}
} else {
Expand Down
6 changes: 4 additions & 2 deletions src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ export function isMessageStartMessage(message: any): message is StartMessage {
const test = "test"
export type TestMessage = {
type: typeof test
options: StartOptions
}

export function createTestMessage(): TestMessage {
export function createTestMessage(options: StartOptions): TestMessage {
return {
type: test
type: test,
options
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ function IndexPopup() {
if (!activeTab.id) {
return
}
chrome.tabs.sendMessage<TestMessage>(activeTab.id, createTestMessage())
chrome.tabs.sendMessage<TestMessage>(
activeTab.id,
createTestMessage({ withScoreboard, initialBallSpeed, sound })
)
window.close()
})
}
Expand Down

0 comments on commit 4c0ec18

Please sign in to comment.