diff --git a/package.json b/package.json index 01f5100e..7eab4cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-ui", - "version": "0.18.0", + "version": "0.18.1-rc.1", "description": "An isomorphic UI for lemmy", "repository": "https://github.com/LemmyNet/lemmy-ui", "license": "AGPL-3.0", diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 382f5650..45857a0d 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -4,6 +4,7 @@ import { Component, InfernoKeyboardEvent, InfernoMouseEvent, + InfernoNode, linkEvent, } from "inferno"; import { @@ -13,6 +14,7 @@ import { Instance, ListingType, } from "lemmy-js-client"; +import deepEqual from "lodash.isequal"; import { I18NextService } from "../../services"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; @@ -55,6 +57,7 @@ export class SiteForm extends Component { initSiteForm(): EditSite { const site = this.props.siteRes.site_view.site; const ls = this.props.siteRes.site_view.local_site; + return { name: site.name, sidebar: site.sidebar, @@ -619,6 +622,19 @@ export class SiteForm extends Component { ); } + componentDidUpdate( + prevProps: Readonly<{ children?: InfernoNode } & SiteFormProps> + ) { + if ( + !( + deepEqual(prevProps.allowedInstances, this.props.allowedInstances) || + deepEqual(prevProps.blockedInstances, this.props.blockedInstances) + ) + ) { + this.setState({ siteForm: this.initSiteForm() }); + } + } + federatedInstanceSelect(key: InstanceKey) { const id = `create_site_${key}`; const value = this.state.instance_select[key]; diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 622e9312..afd88184 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -692,6 +692,8 @@ export class Profile extends Component< > {I18NextService.i18n.t("cancel")} + +
- ); - } - postActions() { // Possible enhancement: Priority+ pattern instead of just hard coding which get hidden behind the show more button. // Possible enhancement: Make each button a component. @@ -662,14 +653,7 @@ export class PostListing extends Component { {this.saveButton} {this.crossPostButton} - {/** - * If there is a URL, or if the post has a body and we were told not to - * show the body, show the MetadataCard/body toggle. - */} - {(post.url || (post.body && !this.props.showBody)) && - this.showPreviewButton()} - - {this.showBody && post_view.post.body && this.viewSourceButton} + {this.props.showBody && post_view.post.body && this.viewSourceButton}
); } diff --git a/src/shared/config.ts b/src/shared/config.ts index c56c64b0..97b28d25 100644 --- a/src/shared/config.ts +++ b/src/shared/config.ts @@ -21,7 +21,7 @@ export const markdownFieldCharacterLimit = 50000; export const maxUploadImages = 20; export const concurrentImageUpload = 4; export const updateUnreadCountsInterval = 30000; -export const fetchLimit = 40; +export const fetchLimit = 20; export const relTags = "noopener nofollow"; export const emDash = "\u2014"; diff --git a/webpack.config.js b/webpack.config.js index dcb88c52..4d95a80c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,8 +6,7 @@ const CopyPlugin = require("copy-webpack-plugin"); const RunNodeWebpackPlugin = require("run-node-webpack-plugin"); const merge = require("lodash.merge"); const { ServiceWorkerPlugin } = require("service-worker-webpack"); -const BundleAnalyzerPlugin = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; + const banner = ` hash:[contentHash], chunkhash:[chunkhash], name:[name], filebase:[base], query:[query], file:[file] Source code: https://github.com/LemmyNet/lemmy-ui @@ -156,6 +155,8 @@ const createClientConfig = (_env, mode) => { }); if (mode === "none") { + const BundleAnalyzerPlugin = + require("webpack-bundle-analyzer").BundleAnalyzerPlugin; config.plugins.push(new BundleAnalyzerPlugin()); }