Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
hotfix: prevent crash when image is locked
Browse files Browse the repository at this point in the history
  • Loading branch information
hirbod committed Nov 20, 2023
1 parent d260630 commit 24e404f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const ImagePreview = ({
);
}}
disabled={!isViewable}
style={{ display: isViewable ? undefined : "none" }}
>
<AnimatedImage
ref={animatedRef}
Expand All @@ -56,12 +57,16 @@ export const ImagePreview = ({
recyclingKey={attachment.attachments[0]?.media_upload}
width={width}
height={height}
source={{
uri: fileObj.url
? `${fileObj.url}?optimizer=image&width=300`
: undefined,
width: 600,
}}
source={
fileObj.url
? {
uri: fileObj.url
? `${fileObj.url}?optimizer=image&width=300`
: undefined,
width: 300,
}
: undefined
}
alt=""
style={[
{ borderRadius: 8 },
Expand All @@ -71,7 +76,7 @@ export const ImagePreview = ({
]}
/>
</Pressable>
{isViewable ? null : (
{!isViewable ? (
<LeanView
tw="items-center justify-center rounded-lg bg-gray-800 bg-opacity-90"
style={{ width, height }}
Expand All @@ -80,7 +85,7 @@ export const ImagePreview = ({
Unlock to view
</LeanText>
</LeanView>
)}
) : null}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export const MessageItem = memo(
{loremText}
</LeanText>
</LeanView>
) : (
) : item.channel_message.body_text_length > 0 ? (
<>
<LeanText tw="py-1.5 text-sm text-gray-900 dark:text-gray-100">
{loremText}
Expand All @@ -394,7 +394,7 @@ export const MessageItem = memo(
}}
/>
</>
)}
) : null}
</LeanView>
) : (
<>
Expand Down

0 comments on commit 24e404f

Please sign in to comment.