Skip to content

Conversation

bep
Copy link
Member

@bep bep commented May 23, 2025

Fixes #13727

@bep bep force-pushed the fix/disablefast-13727 branch from 5e1e893 to f4b13f3 Compare May 23, 2025 12:55
@bep bep requested a review from Copilot May 23, 2025 17:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures the browser is force-refreshed on content changes even when --disableFastRender is enabled.

  • Adds an else branch to always call livereload.ForceRefresh() when changes occur.
  • Duplicates the logging and refresh calls to cover both fast-render-enabled and disabled cases.

Comment on lines 972 to +977
lrl.Logf("force refresh")
livereload.ForceRefresh()
}
} else {
lrl.Logf("force refresh")
livereload.ForceRefresh()
Copy link
Preview

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code for logging and forcing a refresh is duplicated in both branches. Consider moving lrl.Logf("force refresh") and livereload.ForceRefresh() after the if statement to reduce duplication and simplify the control flow.

Suggested change
lrl.Logf("force refresh")
livereload.ForceRefresh()
}
} else {
lrl.Logf("force refresh")
livereload.ForceRefresh()
forceRefreshNeeded = true
}
} else {
forceRefreshNeeded = true

Copilot uses AI. Check for mistakes.

@bep bep merged commit f471936 into gohugoio:master May 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--disableFastRender breaks livereload
1 participant