From 34d1a34b10f4386865f3c241c5ae4026d2bfd8bd Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Sat, 5 Aug 2023 01:11:43 -0400
Subject: Migrate most of frontend callServerMethod usage over to websocket

---
 frontend/src/components/settings/pages/developer/index.tsx | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'frontend/src/components/settings/pages/developer/index.tsx')

diff --git a/frontend/src/components/settings/pages/developer/index.tsx b/frontend/src/components/settings/pages/developer/index.tsx
index 5ed76515..36d3b5c0 100644
--- a/frontend/src/components/settings/pages/developer/index.tsx
+++ b/frontend/src/components/settings/pages/developer/index.tsx
@@ -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) {
+              try {
+                let tabId = await window.DeckyBackend.call<[name: string], string>(
+                  'utilities/get_tab_id',
+                  'SharedJSContext',
+                );
                 Navigation.NavigateToExternalWeb(
-                  'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + res.result,
+                  'localhost:8080/devtools/inspector.html?ws=localhost:8080/devtools/page/' + tabId,
                 );
-              } else {
-                console.error('Unable to find ID for SharedJSContext tab ', res.result);
+              } catch (e) {
+                console.error('Unable to find ID for SharedJSContext tab ', e);
                 Navigation.NavigateToExternalWeb('localhost:8080');
               }
             }}
-- 
cgit v1.2.3

