mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-23 03:11:25 +00:00
Fix consent modal showing up for currently logged in admin
This commit is contained in:
parent
4fc425b286
commit
b6d7efd8ae
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,7 @@ import { adultConsentLocalStorageKey } from "../../config";
|
||||||
import { setIsoData } from "@utils/app";
|
import { setIsoData } from "@utils/app";
|
||||||
import { IsoDataOptionalSite } from "../../interfaces";
|
import { IsoDataOptionalSite } from "../../interfaces";
|
||||||
import { mdToHtml } from "../../markdown";
|
import { mdToHtml } from "../../markdown";
|
||||||
|
import { UserService } from "../../services";
|
||||||
|
|
||||||
interface AdultConsentModalProps {
|
interface AdultConsentModalProps {
|
||||||
contentWarning: string;
|
contentWarning: string;
|
||||||
|
@ -95,7 +96,10 @@ export default class AdultConsentModal extends Component<
|
||||||
|
|
||||||
if (
|
if (
|
||||||
siteRes?.site_view.site.content_warning &&
|
siteRes?.site_view.site.content_warning &&
|
||||||
!(siteRes?.my_user || localStorage.getItem(adultConsentLocalStorageKey))
|
!(
|
||||||
|
UserService.Instance.myUserInfo ||
|
||||||
|
localStorage.getItem(adultConsentLocalStorageKey)
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
this.setState({ show: true });
|
this.setState({ show: true });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue