diff --git a/lemmy-translations b/lemmy-translations index 38bb32f6..a0f95fc2 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 38bb32f6898b227aaad06a48d8bf69a5b48416d6 +Subproject commit a0f95fc29b7501156b6d8bbb504b1e787b5769e7 diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index 90c868af..b715219a 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -47,16 +47,16 @@ async function handleLoginSubmit(i: Login, event: any) { }); switch (loginRes.state) { case "failed": { - if (loginRes.msg === "missing_totp_token") { - i.setState({ showTotp: true }); - toast(I18NextService.i18n.t("enter_two_factor_code"), "info"); - } else { - toast(I18NextService.i18n.t(loginRes.msg), "danger"); - } + if (loginRes.msg === "missing_totp_token") { + i.setState({ showTotp: true }); + toast(I18NextService.i18n.t("enter_two_factor_code"), "info"); + } else { + toast(I18NextService.i18n.t(loginRes.msg), "danger"); + } - i.setState({ loginRes: { state: "failed", msg: loginRes.msg } }); - break; - } + i.setState({ loginRes: { state: "failed", msg: loginRes.msg } }); + break; + } case "success": { UserService.Instance.login({ diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 5e387972..a606a19d 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -1289,7 +1289,7 @@ export class Settings extends Component { const deleteAccountRes = await HttpService.client.deleteAccount({ password, auth: myAuthRequired(), - // TODO: promt user weather he wants the content to be deleted + // TODO: promt user weather he wants the content to be deleted, delete_content: false, }); if (deleteAccountRes.state === "success") { diff --git a/src/shared/utils/roles/is-admin.ts b/src/shared/utils/roles/is-admin.ts index 2a5237e2..8332c51c 100644 --- a/src/shared/utils/roles/is-admin.ts +++ b/src/shared/utils/roles/is-admin.ts @@ -4,5 +4,5 @@ export default function isAdmin( creatorId: number, admins?: PersonView[], ): boolean { - return admins?.map(a => a.person.id).includes(creatorId) ?? false; + return admins?.some(({ person: { id } }) => id === creatorId) ?? false; } diff --git a/webpack.config.js b/webpack.config.js index b12af483..d855b475 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -148,7 +148,7 @@ module.exports = (env, argv) => { const RunNodeWebpackPlugin = require("run-node-webpack-plugin"); serverConfig.plugins.push( - new RunNodeWebpackPlugin({ runOnlyInWatchMode: true }) + new RunNodeWebpackPlugin({ runOnlyInWatchMode: true }), ); } else if (mode === "none") { const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");