Fix incorrectly escaped user export JSON (#2412)

Resolves https://github.com/LemmyNet/lemmy/issues/4600
This commit is contained in:
Alexander Harding 2024-04-10 07:15:43 -05:00 committed by GitHub
parent 0894c77b6c
commit 7c891a42b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1615,9 +1615,9 @@ export class Settings extends Component<SettingsRouteProps, SettingsState> {
const res = await HttpService.client.exportSettings();
if (res.state === "success") {
i.exportSettingsLink.current!.href = encodeURI(
`data:application/json,${JSON.stringify(res.data)}`,
);
i.exportSettingsLink.current!.href = `data:application/json,${encodeURIComponent(
JSON.stringify(res.data),
)}`;
i.exportSettingsLink.current?.click();
} else if (res.state === "failed") {
toast(