diff --git a/lemmy-translations b/lemmy-translations index 37c437e7..7ba4cac3 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 37c437e753b52b1a61b225df9d4ffd99ddf17314 +Subproject commit 7ba4cac33e47b712227c2b8a133c489abed7c727 diff --git a/package.json b/package.json index 7d6e1a8e..4336aedf 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "inferno-router": "^8.2.3", "inferno-server": "^8.2.3", "jwt-decode": "^4.0.0", - "lemmy-js-client": "0.19.6-beta.1", + "lemmy-js-client": "0.20.0-alpha.7", "lodash.isequal": "^4.5.0", "markdown-it": "^14.1.0", "markdown-it-bidi": "^0.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bef9fc31..e0a7c82f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,8 +114,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 lemmy-js-client: - specifier: 0.19.6-beta.1 - version: 0.19.6-beta.1 + specifier: 0.20.0-alpha.7 + version: 0.20.0-alpha.7 lodash.isequal: specifier: ^4.5.0 version: 4.5.0 @@ -3063,8 +3063,8 @@ packages: leac@0.6.0: resolution: {integrity: sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==} - lemmy-js-client@0.19.6-beta.1: - resolution: {integrity: sha512-CiTbTpqKA7t1daBMdkKVLVXUrpy2wSuxkoWrnK5sVvmBrlFq1jpqC9h9SgNngiVqSgx6Tvsg3asmvne7OaEZRQ==} + lemmy-js-client@0.20.0-alpha.7: + resolution: {integrity: sha512-lhPs8gJFLX0EvlwkkgtTF2F/v22lKjcQ81u7u5CShrO05Dii33fZ5x9SrEJYHD0qw4FIN/jpfKucN9QnndScpA==} leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} @@ -7834,7 +7834,7 @@ snapshots: leac@0.6.0: {} - lemmy-js-client@0.19.6-beta.1: {} + lemmy-js-client@0.20.0-alpha.7: {} leven@3.1.0: {} diff --git a/src/shared/components/comment/comment-node.tsx b/src/shared/components/comment/comment-node.tsx index 5313dcbe..905c730f 100644 --- a/src/shared/components/comment/comment-node.tsx +++ b/src/shared/components/comment/comment-node.tsx @@ -637,7 +637,7 @@ export class CommentNode extends Component { async handleBanFromCommunity({ daysUntilExpires, reason, - shouldRemove, + shouldRemoveOrRestoreData, }: BanUpdateForm) { const { creator: { id: person_id }, @@ -646,10 +646,9 @@ export class CommentNode extends Component { } = this.commentView; const ban = !creator_banned_from_community; - // If its an unban, restore all their data if (ban === false) { - shouldRemove = false; + shouldRemoveOrRestoreData = true; } const expires = futureDaysToUnixTime(daysUntilExpires); @@ -657,7 +656,7 @@ export class CommentNode extends Component { community_id, person_id, ban, - remove_data: shouldRemove, + remove_or_restore_data: shouldRemoveOrRestoreData, reason, expires, }); @@ -666,7 +665,7 @@ export class CommentNode extends Component { async handleBanFromSite({ daysUntilExpires, reason, - shouldRemove, + shouldRemoveOrRestoreData, }: BanUpdateForm) { const { creator: { id: person_id, banned }, @@ -676,14 +675,14 @@ export class CommentNode extends Component { // If its an unban, restore all their data if (ban === false) { - shouldRemove = false; + shouldRemoveOrRestoreData = true; } const expires = futureDaysToUnixTime(daysUntilExpires); this.props.onBanPerson({ person_id, ban, - remove_data: shouldRemove, + remove_or_restore_data: shouldRemoveOrRestoreData, reason, expires, }); diff --git a/src/shared/components/common/modal/mod-action-form-modal.tsx b/src/shared/components/common/modal/mod-action-form-modal.tsx index fea9405c..84487d97 100644 --- a/src/shared/components/common/modal/mod-action-form-modal.tsx +++ b/src/shared/components/common/modal/mod-action-form-modal.tsx @@ -16,7 +16,7 @@ import { modalMixin } from "../../mixins/modal-mixin"; export interface BanUpdateForm { reason?: string; - shouldRemove?: boolean; + shouldRemoveOrRestoreData?: boolean; daysUntilExpires?: number; } @@ -69,7 +69,7 @@ interface ModActionFormFormState { loading: boolean; reason: string; daysUntilExpire?: number; - shouldRemoveData?: boolean; + shouldRemoveOrRestoreData?: boolean; shouldPermaBan?: boolean; } @@ -84,7 +84,7 @@ function handleExpiryChange(i: ModActionFormModal, event: any) { function handleToggleRemove(i: ModActionFormModal) { i.setState(prev => ({ ...prev, - shouldRemoveData: !prev.shouldRemoveData, + shouldRemoveOrRestoreData: !prev.shouldRemoveOrRestoreData, })); } @@ -104,7 +104,7 @@ async function handleSubmit(i: ModActionFormModal, event: any) { await i.props.onSubmit({ reason: i.state.reason, daysUntilExpires: i.state.daysUntilExpire!, - shouldRemove: i.state.shouldRemoveData!, + shouldRemoveOrRestoreData: i.state.shouldRemoveOrRestoreData!, } as BanUpdateForm & string); // Need to & string to handle type weirdness } else { await i.props.onSubmit(i.state.reason); @@ -135,7 +135,7 @@ export default class ModActionFormModal extends Component< this.reasonRef = createRef(); if (this.isBanModal) { - this.state.shouldRemoveData = false; + this.state.shouldRemoveOrRestoreData = false; } } @@ -144,7 +144,7 @@ export default class ModActionFormModal extends Component< loading, reason, daysUntilExpire, - shouldRemoveData, + shouldRemoveOrRestoreData, shouldPermaBan, } = this.state; const reasonId = `mod-form-reason-${randomStr()}`; @@ -249,7 +249,7 @@ export default class ModActionFormModal extends Component< {I18NextService.i18n.t("remove_content")} diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 43036559..5eac726a 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -64,7 +64,6 @@ export class SiteForm extends Component { description: site.description, enable_downvotes: ls.enable_downvotes, registration_mode: ls.registration_mode, - enable_nsfw: ls.enable_nsfw, community_creation_admin_only: ls.community_creation_admin_only, icon: site.icon, banner: site.banner, diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index 2f586226..04f0445d 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -119,7 +119,7 @@ interface ProfileState { banReason?: string; banExpireDays?: number; showBanDialog: boolean; - removeData: boolean; + removeOrRestoreData: boolean; siteRes: GetSiteResponse; isIsomorphic: boolean; showRegistrationDialog: boolean; @@ -182,7 +182,7 @@ function isPersonBlocked(personRes: RequestState) { return ( (personRes.state === "success" && UserService.Instance.myUserInfo?.person_blocks.some( - ({ target: { id } }) => id === personRes.data.person_view.person.id, + ({ id }) => id === personRes.data.person_view.person.id, )) ?? false ); @@ -206,7 +206,7 @@ export class Profile extends Component { personBlocked: false, siteRes: this.isoData.site_res, showBanDialog: false, - removeData: false, + removeOrRestoreData: false, isIsomorphic: false, showRegistrationDialog: false, registrationRes: EMPTY_REQUEST, @@ -891,7 +891,7 @@ export class Profile extends Component { className="form-check-input" id="mod-ban-remove-data" type="checkbox" - checked={this.state.removeData} + checked={this.state.removeOrRestoreData} onChange={linkEvent(this, this.handleModRemoveDataChange)} />