Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
back to caching avatars (#1321)
Browse files Browse the repository at this point in the history
Signed-off-by: andrew <[email protected]>
  • Loading branch information
andrewxhill authored Aug 26, 2019
1 parent f752859 commit 9c06155
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions App/Components/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,28 +210,48 @@ class Avatar extends React.Component<Props, State> {
uri: `${
Config.RN_TEXTILE_GATEWAY_URL
}/ipfs/${target}/0/small/content`,
cache: 'reload'
cache: 'force-cache'
}}
resizeMode={'cover'}
onLoad={this.onHTTPLoad}
>
{shouldShowIPFS && (
<TextileImage
style={{
minHeight: height,
minWidth: width,
alignSelf: 'center',
backgroundColor: 'transparent'
}}
target={`${target}/0/${resolution}/content`}
ipfs={true}
index={0}
forMinWidth={widthNumber}
resizeMode={'cover'}
onLayout={this.onImageLayout}
onError={this.onIPFSError}
/>
)}
<ImageBackground
style={{
minHeight: height,
minWidth: width,
alignSelf: 'center',
backgroundColor:
this.props.style && this.props.style.backgroundColor
? this.props.style.backgroundColor
: 'transparent'
}}
source={{
uri: `${
Config.RN_TEXTILE_GATEWAY_URL
}/ipfs/${target}/0/small/content`,
cache: 'reload'
}}
resizeMode={'cover'}
onLoad={this.onHTTPLoad}
>
{shouldShowIPFS && (
<TextileImage
style={{
minHeight: height,
minWidth: width,
alignSelf: 'center',
backgroundColor: 'transparent'
}}
target={`${target}/0/${resolution}/content`}
ipfs={true}
index={0}
forMinWidth={widthNumber}
resizeMode={'cover'}
onLayout={this.onImageLayout}
onError={this.onIPFSError}
/>
)}
</ImageBackground>
</ImageBackground>
</View>
)
Expand Down

0 comments on commit 9c06155

Please sign in to comment.