deep: true,
handler(oldFilters, newFilters) {
- if (this.filterQuerystring !== '') {
-
- // Using square brackets in the URL can cause problems due to URL encoding and decoding
- // so it's better to remove them while also shortening the URL to simply use Fx=...
- const safeQuerystring = this.filterQuerystring.replace(/filter\[(\d+)]/g, 'F$1');
-
- history.replaceState(newFilters, '', '?' + safeQuerystring);
- }
+ // Using square brackets in the URL can cause problems due to URL encoding and decoding
+ // so it's better to remove them while also shortening the URL to simply use Fx=...
+ const safeQuerystring = this.filterQuerystring.replace(/filter\[(\d+)]/g, 'F$1');
+ history.replaceState(newFilters, '', '?' + safeQuerystring);
}
}
},