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