From 24de617b92cf2638bbd963ce28ace5cda4cc5d4d Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Fri, 20 Jan 2023 00:25:12 -0800 Subject: [PATCH] Fix webkit reload (#534) * wrap WKWebView in UnsafePointer * formatting * more formatting --- apps/desktop/src-tauri/native/macos/Sources/webview.swift | 3 ++- crates/sync/example/web/src/App.tsx | 2 +- packages/interface/src/components/explorer/FileRow.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/desktop/src-tauri/native/macos/Sources/webview.swift b/apps/desktop/src-tauri/native/macos/Sources/webview.swift index f46c1a159..02388d90e 100644 --- a/apps/desktop/src-tauri/native/macos/Sources/webview.swift +++ b/apps/desktop/src-tauri/native/macos/Sources/webview.swift @@ -1,7 +1,8 @@ import WebKit @_cdecl("reload_webview") -public func reloadWebview(webview: WKWebView) -> () { +public func reloadWebview(webviewPtr: UnsafePointer) -> () { + let webview = webviewPtr.pointee; webview.window!.orderOut(webview); webview.reload(); webview.window!.makeKey(); diff --git a/crates/sync/example/web/src/App.tsx b/crates/sync/example/web/src/App.tsx index 13c4e5d1c..a1ecf0e40 100644 --- a/crates/sync/example/web/src/App.tsx +++ b/crates/sync/example/web/src/App.tsx @@ -67,7 +67,7 @@ interface DatabaseViewProps { const TABS = ['File Paths', 'Objects', 'Tags', 'Operations']; function DatabaseView(props: DatabaseViewProps) { - const [currentTab, setCurrentTab] = useState('Operations'); + const [currentTab, setCurrentTab] = useState<(typeof TABS)[number]>('Operations'); const pullOperations = rspc.useMutation('pullOperations'); diff --git a/packages/interface/src/components/explorer/FileRow.tsx b/packages/interface/src/components/explorer/FileRow.tsx index d4f15750e..a9c357382 100644 --- a/packages/interface/src/components/explorer/FileRow.tsx +++ b/packages/interface/src/components/explorer/FileRow.tsx @@ -89,6 +89,6 @@ const columns = ensureIsColumns([ { column: 'Type', key: 'extension', width: 100 } as const ]); -type ColumnKey = typeof columns[number]['key']; +type ColumnKey = (typeof columns)[number]['key']; export default FileRow;