소스 검색

Preserve Reddit browsing state when returning from other sidebar items.

Only reload the in-app web view when navigating to an explicit URL, so reopening Reddit resumes where the user left off.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 1 개월 전
부모
커밋
f0be756642
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      Reddit App/ViewModels/FrontPageViewModel.swift

+ 5 - 3
Reddit App/ViewModels/FrontPageViewModel.swift

@@ -40,9 +40,11 @@ final class FrontPageViewModel {
         isRedditActive = true
         isSettingsActive = false
         isHistoryActive = false
-        let targetURL = url ?? Self.redditHomeURL
-        redditLoadURL = targetURL
-        if RedditWebAuthHelper.isRedditHomeURL(targetURL) {
+
+        guard let url else { return }
+
+        redditLoadURL = url
+        if RedditWebAuthHelper.isRedditHomeURL(url) {
             redditCanGoBack = false
         }
         redditReloadTrigger += 1