mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 18:22:11 +00:00
[bugfix/frontend] Decode URI component domain before showing on frontend (#2043)
This commit is contained in:
parent
a5a80b4bbe
commit
de148e9f9f
|
@ -38,11 +38,14 @@ module.exports = function InstanceDetail({ baseUrl }) {
|
|||
const { data: blockedInstances = {}, isLoading } = query.useInstanceBlocksQuery();
|
||||
|
||||
let [_match, { domain }] = useRoute(`${baseUrl}/:domain`);
|
||||
|
||||
if (domain == "view") { // from form field submission
|
||||
if (domain == "view") {
|
||||
// Retrieve domain from form field submission.
|
||||
domain = (new URL(document.location)).searchParams.get("domain");
|
||||
}
|
||||
|
||||
// Normalize / decode domain (it may be URL-encoded).
|
||||
domain = decodeURIComponent(domain);
|
||||
|
||||
const existingBlock = React.useMemo(() => {
|
||||
return blockedInstances[domain];
|
||||
}, [blockedInstances, domain]);
|
||||
|
|
Loading…
Reference in a new issue