Clear window scroll position from state restoration when no article is selected. Fixes a bug where restoring to no article, followed by clicking an article, would auto-scroll the web view when it shouldn’t.

This commit is contained in:
Brent Simmons committed 2026-11-11 10:46:37 -08:00
1 parent 0f5046bbb6
commit e2c41220ff
1 file changed
+3 -1
@@ -40,7 +40,9 @@ final class DetailWebViewController: NSViewController {
}
var windowState: DetailWindowState {
DetailWindowState(isShowingExtractedArticle: isShowingExtractedArticle, windowScrollY: windowScrollY ?? 0)
// Without an article there’s no scroll position worth saving.
let scrollY = article == nil ? 0 : (windowScrollY ?? 0)
return DetailWindowState(isShowingExtractedArticle: isShowingExtractedArticle, windowScrollY: scrollY)
}
var article: Article? {