Don't allow transfer site. (#551)

* Don't allow transfer site.

* Updating translations.

* Adding leave admin team.
This commit is contained in:
Dessalines 2022-02-14 12:27:43 -05:00 committed by GitHub
parent 055ed466d3
commit 399149b278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 112 deletions

View file

@ -18,7 +18,6 @@ import {
RemoveComment,
SaveComment,
TransferCommunity,
TransferSite,
} from "lemmy-js-client";
import moment from "moment";
import { i18n } from "../../i18next";
@ -686,51 +685,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
))}
</>
)}
{/* Site Creator can transfer to another admin */}
{this.amSiteCreator &&
this.isAdmin &&
cv.creator.local &&
(!this.state.showConfirmTransferSite ? (
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(
this,
this.handleShowConfirmTransferSite
)}
aria-label={i18n.t("transfer_site")}
>
{i18n.t("transfer_site")}
</button>
) : (
<>
<button
class="btn btn-link btn-animate text-muted"
aria-label={i18n.t("are_you_sure")}
>
{i18n.t("are_you_sure")}
</button>
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(
this,
this.handleTransferSite
)}
aria-label={i18n.t("yes")}
>
{i18n.t("yes")}
</button>
<button
class="btn btn-link btn-animate text-muted"
onClick={linkEvent(
this,
this.handleCancelShowConfirmTransferSite
)}
aria-label={i18n.t("no")}
>
{i18n.t("no")}
</button>
</>
))}
</>
)}
</>
@ -1339,16 +1293,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
i.setState(i.state);
}
handleTransferSite(i: CommentNode) {
let form: TransferSite = {
person_id: i.props.node.comment_view.creator.id,
auth: authField(),
};
WebSocketService.Instance.send(wsClient.transferSite(form));
i.state.showConfirmTransferSite = false;
i.setState(i.state);
}
get isCommentNew(): boolean {
let now = moment.utc().subtract(10, "minutes");
let then = moment.utc(this.props.node.comment_view.comment.published);