Skip to content

Commit 70289b1

Browse files
committed
refactor: webview hard reload
1 parent 3c4e907 commit 70289b1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Discord/WebView.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,11 +693,8 @@ struct WebView: NSViewRepresentable {
693693
func hardReloadWebView(webView: WKWebView) {
694694
webView.configuration.userContentController.removeAllUserScripts()
695695
loadPluginsAndCSS(webView: webView)
696-
guard let releaseChannel = UserDefaults.standard.string(forKey: "discordReleaseChannel"),
697-
let url = DiscordReleaseChannel(rawValue: releaseChannel)?.url else {
698-
webView.load(URLRequest(url: DiscordReleaseChannel.stable.url))
699-
return
700-
}
696+
let releaseChannel = UserDefaults.standard.string(forKey: "discordReleaseChannel") ?? ""
697+
let url = DiscordReleaseChannel(rawValue: releaseChannel)?.url ?? DiscordReleaseChannel.stable.url
701698

702699
webView.load(URLRequest(url: url))
703700
}

0 commit comments

Comments
 (0)