Merge branch 'main' into use_http_client_2

This commit is contained in:
SleeplessOne1917 2023-06-09 00:59:39 +00:00 committed by GitHub
commit a1393131f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -26,6 +26,7 @@ import {
favIconUrl, favIconUrl,
initializeSite, initializeSite,
isAuthPath, isAuthPath,
md,
} from "../shared/utils"; } from "../shared/utils";
const server = express(); const server = express();
@ -353,7 +354,9 @@ async function createSsrHtml(root: string, isoData: IsoDataOptionalSite) {
<!DOCTYPE html> <!DOCTYPE html>
<html ${helmet.htmlAttributes.toString()} lang="en"> <html ${helmet.htmlAttributes.toString()} lang="en">
<head> <head>
<script>window.isoData = ${JSON.stringify(isoData)}</script> <script>window.isoData = ${md.utils.escapeHtml(
JSON.stringify(isoData)
)}</script>
<script>window.lemmyConfig = ${serialize(config)}</script> <script>window.lemmyConfig = ${serialize(config)}</script>
<!-- A remote debugging utility for mobile --> <!-- A remote debugging utility for mobile -->

View file

@ -488,6 +488,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
const pForm = i.state.form; const pForm = i.state.form;
const pv = i.props.post_view; const pv = i.props.post_view;
if (pv) { if (pv) {
i.props.onEdit?.({ i.props.onEdit?.({
name: pForm.name, name: pForm.name,
@ -495,7 +496,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
body: pForm.body, body: pForm.body,
nsfw: pForm.nsfw, nsfw: pForm.nsfw,
post_id: pv.post.id, post_id: pv.post.id,
language_id: pv.post.language_id, language_id: pForm.language_id,
auth, auth,
}); });
} else if (pForm.name && pForm.community_id) { } else if (pForm.name && pForm.community_id) {