remove unused torrentIds

This commit is contained in:
Martti Malmi 2023-08-16 15:49:29 +03:00
parent 58fbc722a2
commit d2be00cc32
5 changed files with 3 additions and 21 deletions

View File

@ -10,16 +10,14 @@ import { DecryptedEvent } from '../views/chat/ChatMessages';
import Name from './user/Name';
import HyperText from './HyperText';
import RelativeTime from './RelativeTime';
import Torrent from './Torrent';
type Props = {
event: DecryptedEvent;
selfAuthored?: boolean;
showName?: boolean;
torrentId?: string;
};
const PrivateMessage = ({ event, selfAuthored, showName, torrentId }: Props) => {
const PrivateMessage = ({ event, selfAuthored, showName }: Props) => {
const [text, setText] = useState(event.text || '');
const [innerEvent, setInnerEvent] = useState<any>(null as any);
const [checked, setChecked] = useState(false);
@ -95,7 +93,6 @@ const PrivateMessage = ({ event, selfAuthored, showName, torrentId }: Props) =>
</small>
)}
</div>
{torrentId && <Torrent torrentId={torrentId} />}
<div className={`preformatted-wrap text-base ${emojiOnly ? 'text-4xl' : ''}`}>
<HyperText event={event}>{text}</HyperText>
</div>

View File

@ -104,7 +104,7 @@ function CreateNoteForm({
const onClickCancel = useCallback(
(e) => {
e.preventDefault();
if (text?.split(' ').length < 10 || confirm(t('discard_changes'))) {
if (!text || text.split(' ').length < 10 || confirm(t('discard_changes'))) {
resetText();
setFocused(false);
}

View File

@ -11,7 +11,6 @@ export interface IProps {
export interface IState {
attachments?: any[];
torrentId?: string;
mentioning?: string;
focused?: boolean;
text: string;

View File

@ -5,7 +5,6 @@ import CreateNoteForm from '@/components/create/CreateNoteForm';
import Reactions from '@/components/events/buttons/ReactionButtons';
import Show from '@/components/helpers/Show';
import HyperText from '@/components/HyperText';
import Torrent from '@/components/Torrent';
import localState from '@/LocalState';
import SocialNetwork from '@/nostr/SocialNetwork';
import { translate as t } from '@/translations/Translation.mjs';
@ -34,19 +33,10 @@ type Props = {
fullWidth?: boolean;
asInlineQuote?: boolean;
event: any;
meta?: any;
isPreview?: boolean;
};
const Content = ({
standalone,
isQuote,
fullWidth,
asInlineQuote,
event,
meta = {},
isPreview,
}: Props) => {
const Content = ({ standalone, isQuote, fullWidth, asInlineQuote, event, isPreview }: Props) => {
const [translatedText, setTranslatedText] = useState('');
const [showMore, setShowMore] = useState(false);
const [name, setName] = useState('');
@ -112,9 +102,6 @@ const Content = ({
<Show when={standalone}>
<Helmet name={name} text={text} attachments={attachments} />
</Show>
<Show when={meta.torrentId}>
<Torrent torrentId={meta.torrentId} autopause={!standalone} />
</Show>
<Show when={text?.length > 0}>
<div
className={`preformatted-wrap pb-1 ${emojiOnly && 'text-2xl'} ${

View File

@ -146,7 +146,6 @@ const Note = ({
</Show>
<Content
event={event}
meta={meta}
standalone={standalone}
isQuote={isQuote}
asInlineQuote={asInlineQuote}