Skip to content

Commit

Permalink
add delay before redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 1, 2025
1 parent 05f6944 commit 22978ae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion MyApp/wwwroot/pages/Questions/Ask.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ export default {
function onSuccess(r) {
localStorage.removeItem('ask')
if (r.redirectTo) {
location.href = r.redirectTo
// When buffering is disabled question is redirected to static page instead of "live" answers page
if (r.redirectTo.startsWith('/questions/')) {
setTimeout(() => {
location.href = r.redirectTo
}, 2000)
} else {
location.href = r.redirectTo
}
}
}

Expand Down

0 comments on commit 22978ae

Please sign in to comment.