mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 10:51:58 +00:00
Migrate most of frontend callServerMethod usage over to websocket
This commit is contained in:
@@ -91,13 +91,16 @@ export default function DeveloperSettings() {
|
||||
>
|
||||
<DialogButton
|
||||
onClick={async () => {
|
||||
let res = await window.DeckyPluginLoader.callServerMethod('get_tab_id', { name: 'SharedJSContext' });
|
||||
if (res.success) {
|
||||
Navigation.NavigateToExternalWeb(
|
||||
'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + res.result,
|
||||
try {
|
||||
let tabId = await window.DeckyBackend.call<[name: string], string>(
|
||||
'utilities/get_tab_id',
|
||||
'SharedJSContext',
|
||||
);
|
||||
} else {
|
||||
console.error('Unable to find ID for SharedJSContext tab ', res.result);
|
||||
Navigation.NavigateToExternalWeb(
|
||||
'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + tabId,
|
||||
);
|
||||
} catch (e) {
|
||||
console.error('Unable to find ID for SharedJSContext tab ', e);
|
||||
Navigation.NavigateToExternalWeb('localhost:8080');
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -18,8 +18,8 @@ export default function RemoteDebuggingSettings() {
|
||||
value={allowRemoteDebugging || false}
|
||||
onChange={(toggleValue) => {
|
||||
setAllowRemoteDebugging(toggleValue);
|
||||
if (toggleValue) window.DeckyPluginLoader.callServerMethod('allow_remote_debugging');
|
||||
else window.DeckyPluginLoader.callServerMethod('disallow_remote_debugging');
|
||||
if (toggleValue) window.DeckyBackend.call('allow_remote_debugging');
|
||||
else window.DeckyBackend.call('disallow_remote_debugging');
|
||||
}}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
Reference in New Issue
Block a user