diff --git a/examples/iframe-playground/packages/client/src/App.tsx b/examples/iframe-playground/packages/client/src/App.tsx index 5ffecd42..8ea7ff0a 100755 --- a/examples/iframe-playground/packages/client/src/App.tsx +++ b/examples/iframe-playground/packages/client/src/App.tsx @@ -20,7 +20,6 @@ import OrientationUpdates from './pages/OrientationUpdates'; import LayoutMode from './pages/LayoutMode'; import PlatformBehaviors from './pages/PlatformBehaviors'; import URLMappingParameters from './pages/URLMappingParameters'; -import VoiceSettings from './pages/VoiceSettings'; import VoiceState from './pages/VoiceState'; import VisibilityListener from './pages/VisibilityListener'; import WindowSizeTracker from './pages/WindowSizeTracker'; @@ -66,11 +65,6 @@ const routes: Record = { name: 'Guilds', component: Guilds, }, - voiceSettings: { - path: '/voice-settings', - name: 'Voice Settings', - component: VoiceSettings, - }, voiceState: { path: '/voice-state', name: 'Voice State', diff --git a/examples/iframe-playground/packages/client/src/pages/VoiceSettings.tsx b/examples/iframe-playground/packages/client/src/pages/VoiceSettings.tsx deleted file mode 100644 index b6157e56..00000000 --- a/examples/iframe-playground/packages/client/src/pages/VoiceSettings.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react'; -import discordSdk from '../discordSdk'; -import ReactJsonView from '../components/ReactJsonView'; - -export default function VoiceSettings() { - const [voiceSettings, setVoiceSettings] = React.useState(null); - const [commandError, setCommandError] = React.useState(null); - - React.useEffect(() => { - const updateVoiceSettings = (voiceSettings: any) => { - setVoiceSettings(voiceSettings); - }; - discordSdk.subscribe('VOICE_SETTINGS_UPDATE', updateVoiceSettings); - return () => { - discordSdk.unsubscribe('VOICE_SETTINGS_UPDATE', updateVoiceSettings); - }; - }, []); - - const getVoiceSettings = async () => { - try { - const voiceSettings = await discordSdk.commands.getVoiceSettings(); - setVoiceSettings(voiceSettings); - } catch (e: any) { - setCommandError(e.message ?? 'Unknown Error'); - } - }; - - return ( -
-
-

Command

-

GET_VOICE_SETTINGS

-
- -
- - {commandError ?

Error: ${commandError}

: null} -
-

Event Subscription

-

VOICE_SETTINGS_UPDATE

-
-
- {voiceSettings ? : null} -
-
- ); -}