Skip to content

Commit

Permalink
add other cachekeys (keybase#27590)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima authored Aug 15, 2024
1 parent df80a29 commit 57ba64f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
6 changes: 4 additions & 2 deletions shared/chat/conversation/attachment-get-titles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ const GetTitles = (p: Props) => {
let preview: React.ReactNode = null
switch (info.type) {
case 'image':
preview = path ? <Kb.ZoomableImage src={info.url ?? path} style={styles.image} /> : null
preview = path ? (
<Kb.ZoomableImage src={info.url ?? path} style={styles.image} boxCacheKey="getTitlesImg" />
) : null
break
case 'video':
preview = path ? <Kb.Video autoPlay={false} allowFile={true} muted={true} url={path} /> : null
break
default: {
if (C.isIOS && path && isPathHEIC(path)) {
preview = <Kb.ZoomableImage src={path} style={styles.image} />
preview = <Kb.ZoomableImage src={path} style={styles.image} boxCacheKey="getTitlesHeicImg" />
} else {
preview = (
<Kb.Box2 direction="vertical" fullWidth={true} fullHeight={true} centerChildren={true}>
Expand Down
4 changes: 2 additions & 2 deletions shared/chat/conversation/fwd-msg/team-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ const TeamPicker = (props: Props) => {
preview = url ? <Kb.Video autoPlay={false} allowFile={true} url={url} muted={true} /> : null
} else {
const src = message.fileURL || message.previewURL
preview = src ? <Kb.ZoomableImage src={src} style={styles.image} /> : null
preview = src ? <Kb.ZoomableImage src={src} style={styles.image} boxCacheKey="fwdimg" /> : null
}
break
default:
// heics
if (C.Chat.isImageViewable(message)) {
const src = message.fileURL || message.previewURL
preview = src ? <Kb.ZoomableImage src={src} style={styles.image} /> : null
preview = src ? <Kb.ZoomableImage src={src} style={styles.image} boxCacheKey="fwdheics" /> : null
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions shared/fs/filepreview/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const FilePreviewViewContent = ({path, onUrlError}: Props) => {
return (
<>
{reloadBanner}
<Kb.ZoomableImage src={url} style={styles.zoomableBox} />
<Kb.ZoomableImage src={url} style={styles.zoomableBox} boxCacheKey="fsdef" />
</>
)
}
Expand All @@ -96,7 +96,7 @@ const FilePreviewViewContent = ({path, onUrlError}: Props) => {
return (
<>
{reloadBanner}
<Kb.ZoomableImage src={url} style={styles.zoomableBox} />
<Kb.ZoomableImage src={url} style={styles.zoomableBox} boxCacheKey="fsimg" />
</>
)
}
Expand Down
8 changes: 7 additions & 1 deletion shared/profile/edit-avatar/index.desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,13 @@ const EditAvatar = (p: Props) => {
style={styles.hidden}
type="file"
/>
<Kb.ZoomableImage dragPan={true} src={imageSource} onChanged={onChanged} onLoaded={onImageLoad} />
<Kb.ZoomableImage
dragPan={true}
src={imageSource}
onChanged={onChanged}
onLoaded={onImageLoad}
boxCacheKey="avatar"
/>
{!loading && (
<Kb.Icon
className="icon"
Expand Down
1 change: 1 addition & 0 deletions shared/profile/edit-avatar/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class AvatarUpload extends React.Component<Props & WrappedProps> {
onChanged={this._onZoom}
// using collapse doesn't work somehow, using devtools it loses the height on android only
style={{...styles.image, ...this.getImageStyle()}}
boxCacheKey="avatar"
/>
) : null
}
Expand Down

0 comments on commit 57ba64f

Please sign in to comment.