Browse Source

lint

feature/pictrs2
DashEightMate 1 year ago
parent
commit
06f09db3af
  1. 12
      src/components/post-form.tsx
  2. 6
      src/components/post-listing.tsx

12
src/components/post-form.tsx

@ -672,7 +672,9 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
file = event;
}
const imageUploadUrl = isProduction ? `/pictrs/image` : `http://localhost:8536/pictrs/image`;
const imageUploadUrl = isProduction
? `/pictrs/image`
: `http://localhost:8536/pictrs/image`;
const formData = new FormData();
formData.append('images[]', file);
@ -690,9 +692,13 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
console.log(res);
if (res.msg == 'ok') {
let hash = res.files[0].file;
let url = isProduction ? `${window.location.origin}/pictrs/image/${hash}` : `http://localhost:8536/pictrs/image/${hash}`;
let url = isProduction
? `${window.location.origin}/pictrs/image/${hash}`
: `http://localhost:8536/pictrs/image/${hash}`;
let deleteToken = res.files[0].delete_token;
let deleteUrl = isProduction ? `${window.location.origin}/pictrs/image/delete/${deleteToken}/${hash}` : `http://localhost:8536/pictrs/image/delete/${deleteToken}/${hash}`;
let deleteUrl = isProduction
? `${window.location.origin}/pictrs/image/delete/${deleteToken}/${hash}`
: `http://localhost:8536/pictrs/image/delete/${deleteToken}/${hash}`;
i.state.postForm.url = url;
i.state.imageLoading = false;
i.setState(i.state);

6
src/components/post-listing.tsx

@ -728,10 +728,10 @@ export class BasePostListing extends Component<
let post = this.props.post;
return (
<PictrsImage
src = {src}
src={src}
thumbnail
nsfw = {post.nsfw || post.community_nsfw}
title = {post.name}
nsfw={post.nsfw || post.community_nsfw}
title={post.name}
/>
);
}

Loading…
Cancel
Save