{this.getRadio(PersonDetailsView.Overview)}
{this.getRadio(PersonDetailsView.Comments)}
{this.getRadio(PersonDetailsView.Posts)}
@@ -409,22 +410,27 @@ export class Profile extends Component<
getRadio(view: PersonDetailsView) {
const { view: urlView } = getProfileQueryParams();
const active = view === urlView;
+ const radioId = randomStr();
return (
-
+
+ >
);
}
diff --git a/src/shared/components/person/registration-applications.tsx b/src/shared/components/person/registration-applications.tsx
index a26dd79e..757170f8 100644
--- a/src/shared/components/person/registration-applications.tsx
+++ b/src/shared/components/person/registration-applications.tsx
@@ -3,7 +3,9 @@ import {
myAuthRequired,
setIsoData,
} from "@utils/app";
+import { randomStr } from "@utils/helpers";
import { RouteDataResponse } from "@utils/types";
+import classNames from "classnames";
import { Component, linkEvent } from "inferno";
import {
ApproveRegistrationApplication,
@@ -125,34 +127,41 @@ export class RegistrationApplications extends Component<
}
unreadOrAllRadios() {
+ const radioId = randomStr();
+
return (
-
+
+
+
+
diff --git a/src/shared/components/person/reports.tsx b/src/shared/components/person/reports.tsx
index c16b17ac..d298930e 100644
--- a/src/shared/components/person/reports.tsx
+++ b/src/shared/components/person/reports.tsx
@@ -5,8 +5,10 @@ import {
myAuthRequired,
setIsoData,
} from "@utils/app";
+import { randomStr } from "@utils/helpers";
import { amAdmin } from "@utils/roles";
import { RouteDataResponse } from "@utils/types";
+import classNames from "classnames";
import { Component, linkEvent } from "inferno";
import {
CommentReportResponse,
@@ -187,34 +189,41 @@ export class Reports extends Component
{
}
unreadOrAllRadios() {
+ const radioId = randomStr();
+
return (
-
+
+
+
+
@@ -222,70 +231,83 @@ export class Reports extends Component
{
}
messageTypeRadios() {
+ const radioId = randomStr();
+
return (
-
+
+
+
+
+
+
+
{amAdmin() && (
-
+
+ >
)}
);
diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx
index dfdf79c4..4caef458 100644
--- a/src/shared/components/person/settings.tsx
+++ b/src/shared/components/person/settings.tsx
@@ -1175,8 +1175,12 @@ export class Settings extends Component
{
...i.state.saveUserSettingsForm,
auth: myAuthRequired(),
});
+
if (saveRes.state === "success") {
- UserService.Instance.login(saveRes.data);
+ UserService.Instance.login({
+ res: saveRes.data,
+ showToast: false,
+ });
toast(I18NextService.i18n.t("saved"));
window.scrollTo(0, 0);
}
@@ -1198,7 +1202,10 @@ export class Settings extends Component {
auth: myAuthRequired(),
});
if (changePasswordRes.state === "success") {
- UserService.Instance.login(changePasswordRes.data);
+ UserService.Instance.login({
+ res: changePasswordRes.data,
+ showToast: false,
+ });
window.scrollTo(0, 0);
toast(I18NextService.i18n.t("password_changed"));
}
diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx
index bcab28e2..a01f1096 100644
--- a/src/shared/components/post/post.tsx
+++ b/src/shared/components/post/post.tsx
@@ -19,10 +19,11 @@ import {
restoreScrollPosition,
saveScrollPosition,
} from "@utils/browser";
-import { debounce } from "@utils/helpers";
+import { debounce, randomStr } from "@utils/helpers";
import { isImage } from "@utils/media";
import { RouteDataResponse } from "@utils/types";
import autosize from "autosize";
+import classNames from "classnames";
import { Component, RefObject, createRef, linkEvent } from "inferno";
import {
AddAdmin,
@@ -430,80 +431,98 @@ export class Post extends Component {
}
sortRadios() {
+ const radioId =
+ this.state.postRes.state === "success"
+ ? this.state.postRes.data.post_view.post.id
+ : randomStr();
+
return (
<>
-
+
+
+
+
+
-
+
+
>
diff --git a/src/shared/services/UserService.ts b/src/shared/services/UserService.ts
index 0724f400..70e8e9ca 100644
--- a/src/shared/services/UserService.ts
+++ b/src/shared/services/UserService.ts
@@ -26,12 +26,18 @@ export class UserService {
this.#setJwtInfo();
}
- public login(res: LoginResponse) {
+ public login({
+ res,
+ showToast = true,
+ }: {
+ res: LoginResponse;
+ showToast?: boolean;
+ }) {
const expires = new Date();
expires.setDate(expires.getDate() + 365);
if (isBrowser() && res.jwt) {
- toast(I18NextService.i18n.t("logged_in"));
+ showToast && toast(I18NextService.i18n.t("logged_in"));
setAuthCookie(res.jwt);
this.#setJwtInfo();
}
diff --git a/src/shared/utils/browser/data-bs-theme.ts b/src/shared/utils/browser/data-bs-theme.ts
index 8d73f315..97433366 100644
--- a/src/shared/utils/browser/data-bs-theme.ts
+++ b/src/shared/utils/browser/data-bs-theme.ts
@@ -1,11 +1,17 @@
+import { MyUserInfo } from "lemmy-js-client";
import isDark from "./is-dark";
-export default function dataBsTheme(user) {
+export default function dataBsTheme(user?: MyUserInfo) {
return (isDark() && user?.local_user_view.local_user.theme === "browser") ||
(user &&
- ["darkly", "darkly-red", "darkly-pureblack"].includes(
- user.local_user_view.local_user.theme
- ))
+ [
+ "darkly",
+ "darkly-red",
+ "darkly-pureblack",
+ "darkly-compact",
+ "i386",
+ "vaporwave-dark",
+ ].includes(user.local_user_view.local_user.theme))
? "dark"
: "light";
}