Skip to content

Commit 548b3f5

Browse files
Copilotkiyarose
andauthored
fix: address DeepSource findings - remove async from warmIndex, safe-unwrap resourceURL, use optional WKNavigation
Agent-Logs-Url: https://github.com/SillyLittleTech/Flean/sessions/649826ec-06e9-407d-b1e4-56c99779f8cc Co-authored-by: kiyarose <75678535+kiyarose@users.noreply.github.com>
1 parent c36df15 commit 548b3f5

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

ios/Flean/iOS/WebViewContainer.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020

2121
// Load bundled Main.html from the app bundle resources
2222
if let url = Bundle.main.url(
23-
forResource: "Main", withExtension: "html", subdirectory: "Base.lproj")
23+
forResource: "Main", withExtension: "html", subdirectory: "Base.lproj"),
24+
let resourceURL = Bundle.main.resourceURL
2425
{
25-
web.loadFileURL(url, allowingReadAccessTo: Bundle.main.resourceURL!)
26+
web.loadFileURL(url, allowingReadAccessTo: resourceURL)
2627
}
2728

2829
return web
@@ -151,7 +152,7 @@
151152
}
152153

153154
// MARK: - WKNavigationDelegate
154-
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
155+
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation?) {
155156
// Update the UI to use iOS-appropriate text. Extension state cannot be
156157
// queried programmatically on iOS (no SFSafariExtensionManager equivalent),
157158
// so we pass null for the enabled state (shows "unknown") and true for

ios/extention/Resources/scripts/wiki-data-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function invalidateIndex () {
139139
* Call this during extension startup so the first findMatchingWiki request
140140
* does not stall waiting for index construction within the content-script timeout.
141141
*/
142-
export async function warmIndex () {
142+
export function warmIndex () {
143143
return ensureIndex()
144144
}
145145

mos/Flean Extension/Resources/scripts/wiki-data-manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function invalidateIndex () {
139139
* Call this during extension startup so the first findMatchingWiki request
140140
* does not stall waiting for index construction within the content-script timeout.
141141
*/
142-
export async function warmIndex () {
142+
export function warmIndex () {
143143
return ensureIndex()
144144
}
145145

0 commit comments

Comments
 (0)