javascript: Don't resubmit when refreshing the page

This was not caught earlier because the problem was masked by turbolinks usage.

Tests:

- Install an app and see the page refreshing.
- Run manual update and see the page refreshing.
- Update Tor configuration and see the page refreshing.
- Run diagnostics from the diagnostics module and see the page refreshing.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-08-26 11:58:10 -07:00 committed by James Valleroy
parent 68bc333842
commit ea037aa944
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -28,7 +28,8 @@ function sleep(ms) {
// Refresh the page once in n seconds
async function refresh(ms) {
await sleep(3000);
window.location.reload();
// Refresh the page without resubmitting the POST data.
window.location = window.location.href;
}
refresh();