Removed the purging of the query parameters

This commit is contained in:
RadoslavL 2023-10-26 11:30:12 +03:00
parent 995df2d296
commit e8c2388589
3 changed files with 14 additions and 5 deletions

View file

@ -32,14 +32,22 @@ function button_press(){
// On the first page, the stored continuation token is null.
if (prev_ctoken === null) {
sessionStorage.removeItem(CONT_CACHE_KEY);
window.location.href = window.location.href.split('?')[0];
let url = window.location.href.split('?')[0];
let params = window.location.href.split('?')[1];
let url_params = new URLSearchParams(params);
url_params.delete('continuation');
window.location.href = `${url}?${url_params.toString()}`;
return;
}
sessionStorage.setItem(CONT_CACHE_KEY, JSON.stringify(prev_data));
let url = window.location.href.split('?')[0];
let params = window.location.href.split('?')[1];
let url_params = new URLSearchParams(params);
url_params.set("continuation", prev_ctoken);
window.location.href = `${window.location.pathname}?continuation=${prev_ctoken}`;
window.location.href = `${url}?${url_params.toString()}`;
};
addEventListener('DOMContentLoaded', function(){