-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from mebtte/refactor/audio
Refactor/audio
- Loading branch information
Showing
33 changed files
with
6,909 additions
and
10,408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface DebugSetting { | ||
audioLogEnabled: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import ReactDOM from 'react-dom'; | ||
|
||
console.log('debug'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { DebugSetting } from '@/constants/debug_setting'; | ||
import definition from '@/definition'; | ||
import storage, { Key } from '@/storage'; | ||
import parseSearch from '@/utils/parse_search'; | ||
import XState from '@/utils/x_state'; | ||
|
||
const query = parseSearch<'debug'>(window.location.search); | ||
const enable = Boolean(definition.DEVELOPMENT || query.debug); | ||
let initialDebugSetting: DebugSetting = { | ||
audioLogEnabled: false, | ||
}; | ||
if (enable) { | ||
const debugSettingFromStorage = await storage.getItem(Key.DEBUG_SETTING); | ||
if (debugSettingFromStorage) { | ||
initialDebugSetting = debugSettingFromStorage; | ||
} | ||
} | ||
|
||
const debugSetting = new XState(initialDebugSetting); | ||
debugSetting.onChange((ds) => storage.setItem(Key.DEBUG_SETTING, ds)); | ||
|
||
export { enable }; | ||
export default debugSetting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.