Merge branch 'nip05-guard' into 'main'

Guard nip05 with features

See merge request soapbox-pub/soapbox!3160
This commit is contained in:
Alex Gleason 2024-10-15 02:43:39 +00:00
commit cbd964d7d4
1 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useAppSelector, useCompose, useOwnAccount, useSettingsNotifications } from 'soapbox/hooks'; import { useAppSelector, useCompose, useFeatures, useOwnAccount, useSettingsNotifications } from 'soapbox/hooks';
import { selectOwnAccount } from 'soapbox/selectors'; import { selectOwnAccount } from 'soapbox/selectors';
import Warning from '../components/warning'; import Warning from '../components/warning';
@ -18,6 +18,7 @@ const WarningWrapper: React.FC<IWarningWrapper> = ({ composeId }) => {
const scheduledStatusCount = useAppSelector((state) => state.scheduled_statuses.size); const scheduledStatusCount = useAppSelector((state) => state.scheduled_statuses.size);
const { account } = useOwnAccount(); const { account } = useOwnAccount();
const settingsNotifications = useSettingsNotifications(); const settingsNotifications = useSettingsNotifications();
const features = useFeatures();
const needsLockWarning = useAppSelector((state) => compose.privacy === 'private' && !selectOwnAccount(state)!.locked); const needsLockWarning = useAppSelector((state) => compose.privacy === 'private' && !selectOwnAccount(state)!.locked);
const hashtagWarning = (compose.privacy !== 'public' && compose.privacy !== 'group') && APPROX_HASHTAG_RE.test(compose.text); const hashtagWarning = (compose.privacy !== 'public' && compose.privacy !== 'group') && APPROX_HASHTAG_RE.test(compose.text);
@ -44,7 +45,7 @@ const WarningWrapper: React.FC<IWarningWrapper> = ({ composeId }) => {
); );
} }
if (account?.source?.nostr?.nip05 === undefined) { if (features.nostr && account?.source?.nostr?.nip05 === undefined) {
return ( return (
<Warning <Warning
message={(settingsNotifications.has('needsNip05')) ? ( message={(settingsNotifications.has('needsNip05')) ? (