fix: Reader stuck on loading — guard checked isLoading which was true
loadInitial() had guard !isLoading but isLoading defaults to true, so it returned immediately without loading. Replaced with hasLoadedOnce flag to prevent double-loading without blocking the first call. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,8 +41,11 @@ final class ReaderViewModel {
|
||||
|
||||
// MARK: - Load
|
||||
|
||||
private var hasLoadedOnce = false
|
||||
|
||||
func loadInitial() async {
|
||||
guard !isLoading else { return }
|
||||
guard !hasLoadedOnce else { return }
|
||||
hasLoadedOnce = true
|
||||
isLoading = true
|
||||
error = nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user