From a884d25c9341c66da58462925e8c62e2e0605d07 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Mon, 31 Jul 2023 12:04:42 -0700 Subject: [PATCH] Contacts List Trusting --- frontend/apps/electron/src/preload.ts | 5 +- .../packages/app/src/components/footer.tsx | 6 +- .../app/src/components/titlebar/common.tsx | 14 +- .../app/src/components/titlebar/linux.tsx | 4 +- .../app/src/components/titlebar/title.tsx | 9 +- .../app/src/components/titlebar/windows.tsx | 4 +- frontend/packages/app/src/models/accounts.ts | 2 + .../app/src/pages/connections-page.tsx | 83 --------- .../packages/app/src/pages/contacts-page.tsx | 163 ++++++++++++++++++ frontend/packages/app/src/pages/main.tsx | 6 +- .../packages/app/src/utils/navigation.tsx | 4 +- 11 files changed, 190 insertions(+), 110 deletions(-) delete mode 100644 frontend/packages/app/src/pages/connections-page.tsx create mode 100644 frontend/packages/app/src/pages/contacts-page.tsx diff --git a/frontend/apps/electron/src/preload.ts b/frontend/apps/electron/src/preload.ts index b6e83ce39b..4e853eeed3 100644 --- a/frontend/apps/electron/src/preload.ts +++ b/frontend/apps/electron/src/preload.ts @@ -7,21 +7,18 @@ process.once('loaded', async () => { ipcRenderer.addListener('initWindow', (info, event) => { // const {route, windowId} = event - console.log('INIT WINDOW', event) + // console.log('INIT WINDOW', event) contextBridge.exposeInMainWorld('windowInfo', event) }) contextBridge.exposeInMainWorld('ipc', { send: (cmd, args) => { - console.log('IPC SENDING', cmd, args) ipcRenderer.send(cmd, args) }, listen: async (cmd: string, handler: (event: any) => void) => { const innerHandler = (value: any) => { - console.log('IPC event received', cmd, value) handler(value) } - console.log('listening!', cmd) ipcRenderer.addListener(cmd, innerHandler) return () => { ipcRenderer.removeListener(cmd, innerHandler) diff --git a/frontend/packages/app/src/components/footer.tsx b/frontend/packages/app/src/components/footer.tsx index 339e136128..10ed46dba5 100644 --- a/frontend/packages/app/src/components/footer.tsx +++ b/frontend/packages/app/src/components/footer.tsx @@ -50,10 +50,10 @@ function FooterContactsButton() { - ) -} - -export default function ConnectionsPage() { - const contacts = useAllAccounts() - const accounts = contacts.data?.accounts || [] - let content = contacts.isLoading ? ( - - ) : accounts.length > 0 ? ( - accounts.map((account) => { - return - }) - ) : ( - - - You have no Connections yet. - - - ) - return ( - <> - - - - {content} - - - -