chore: code clean

This commit is contained in:
Steven
2023-12-09 18:57:18 +08:00
parent 4f05c972d5
commit 9faee68dab
7 changed files with 45 additions and 43 deletions

View File

@ -83,13 +83,3 @@ export const formatBytes = (bytes: number) => {
i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
};
export const clearContentQueryParam = () => {
const urlParams = new URLSearchParams(window.location.search);
urlParams.delete("content");
let url = window.location.pathname;
if (urlParams.toString()) {
url += `?${urlParams.toString()}`;
}
window.history.replaceState({}, "", url);
};