mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-09-19 01:34:14 +00:00
remove unused torrentIds
This commit is contained in:
parent
58fbc722a2
commit
d2be00cc32
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ export interface IProps {
|
||||
|
||||
export interface IState {
|
||||
attachments?: any[];
|
||||
torrentId?: string;
|
||||
mentioning?: string;
|
||||
focused?: boolean;
|
||||
text: string;
|
||||
|
@ -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'} ${
|
||||
|
@ -146,7 +146,6 @@ const Note = ({
|
||||
</Show>
|
||||
<Content
|
||||
event={event}
|
||||
meta={meta}
|
||||
standalone={standalone}
|
||||
isQuote={isQuote}
|
||||
asInlineQuote={asInlineQuote}
|
||||
|
Loading…
Reference in New Issue
Block a user