Skip to content

Commit

Permalink
Add URL length logging in store_data_in_url
Browse files Browse the repository at this point in the history
function
  • Loading branch information
plmrry committed Dec 5, 2023
1 parent 5a8cd1b commit a698c03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flatfront-astro/src/lib/contexts/AppStateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function store_data_in_url<T>(data: T, key: string) {
url.searchParams.set(key, compressed);
window.history.replaceState({}, ``, url.toString());
const url_length = url.toString().length;
log(`URL length: ${url_length}`);
if (url_length > 5000) {
console.error(`URL is too long!`);
}
Expand Down

0 comments on commit a698c03

Please sign in to comment.