Skip to content

Commit

Permalink
fix(ask, robot): hot fix, get time, trim string (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakorzhovnik authored Jul 29, 2024
1 parent 27de60a commit e119e73
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/components/ContentItem/contentItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import useParticle from 'src/hooks/useParticle';
import type { IpfsContentType } from 'src/services/ipfs/types';
import { $TsFixMe } from 'src/types/tsfix';


import SearchItem from '../SearchItem/searchItem';

import { getRankGrade } from '../../utils/search/utils';
Expand Down
3 changes: 2 additions & 1 deletion src/components/TextMarkdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactMarkdown } from 'react-markdown/lib/react-markdown';
import rehypeStringify from 'rehype-stringify';
import rehypeSanitize from 'rehype-sanitize';
import { shortenString } from 'src/utils/string';
import remarkGfm from 'remark-gfm';
import remarkBreaks from 'remark-breaks';
import cx from 'classnames';
Expand Down Expand Up @@ -39,7 +40,7 @@ function TextMarkdown({
},
}}
>
{children}
{preview ? shortenString(children) : children}
</ReactMarkdown>
</div>
);
Expand Down
4 changes: 1 addition & 3 deletions src/components/contentIpfs/contentIpfs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ function ContentIpfs({ details, content, cid, search }: ContentTabProps) {
<VideoPlayerGatewayOnly content={content} details={details} />
)}
{contentType === 'text' && (
<TextMarkdown preview={search}>
{search ? details.text : details.content}
</TextMarkdown>
<TextMarkdown preview={search}>{details.content}</TextMarkdown>
)}
{contentType === 'image' && <Img content={details.content} />}
{contentType === 'pdf' && details.content && (
Expand Down
3 changes: 1 addition & 2 deletions src/hooks/useParticle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { useEffect, useState } from 'react';
import { useBackend } from 'src/contexts/backend/backend';
import useQueueIpfsContent from './useQueueIpfsContent';
import {
IPFSContentDetails,
IPFSContentDetailsMutated,
Expand All @@ -9,6 +7,7 @@ import { ParticleCid } from 'src/types/base';
import { parseArrayLikeToDetails } from 'src/services/ipfs/utils/content';
import { QueueItemStatus } from 'src/services/QueueManager/types';
import { Option } from 'src/types';
import useQueueIpfsContent from './useQueueIpfsContent';
import useRuneMutation from './useRuneMutation';

const useParticle = (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/robot/Layout/RobotHeader/ui/FirstTx/FirstTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function FirstTx({ address }: Props) {
return undefined;
}

const timestamp = data?.tx_responses[0].timestamp as string | undefined;
const timestamp = data.tx_responses[0]?.timestamp as string | undefined;

if (!timestamp) {
return undefined;
Expand Down

0 comments on commit e119e73

Please sign in to comment.