feat: Enable remote input functionality and enhance settings management for remote control

This commit is contained in:
zimplexing
2025-07-11 18:13:06 +08:00
parent bda7329c1a
commit 5f92f76f4b
6 changed files with 245 additions and 123 deletions

View File

@@ -25,6 +25,16 @@ export const useRemoteControlStore = create<RemoteControlState>((set, get) => ({
if (get().isServerRunning) {
return;
}
remoteControlService.init({
onMessage: (message: string) => {
console.log('[RemoteControlStore] Received message:', message);
set({ lastMessage: message });
},
onHandshake: () => {
console.log('[RemoteControlStore] Handshake successful');
set({ isModalVisible: false })
},
});
try {
const url = await remoteControlService.startServer();
console.log(`[RemoteControlStore] Server started, URL: ${url}`);