Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(2526): Fix images on ios and clean up some logging #2536

Merged
merged 2 commits into from
May 20, 2024

Conversation

islathehut
Copy link
Collaborator

@islathehut islathehut commented May 16, 2024

  • Wraps FastImage in a view to fix issue when used with TouchableWithoutFeedback
  • Adds new items to info.plist to allow access to files/photos
  • Fix some bad logs

Pull Request Checklist

  • I have linked this PR to a related GitHub issue.
  • I have added a description of the change (and Github issue number, if any) to the root CHANGELOG.md.

(Optional) Mobile checklist

Please ensure you completed the following checks if you did any changes to the mobile package:

  • I have run e2e tests for mobile
  • I have updated base screenshots for visual regression tests

@islathehut
Copy link
Collaborator Author

Fixes #2526

@islathehut islathehut marked this pull request as ready for review May 16, 2024 18:49
@@ -39,6 +39,8 @@
<false/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the items added here, even the ones that don't seem relevant (e.g. NSAppleMusicUsageDescription) are required to get access to files we need for uploading files.

@@ -95,7 +95,7 @@ export function subscribe(socket: Socket) {
})
// Misc
socket.on(SocketActionTypes.PEER_CONNECTED, (payload: { peers: string[] }) => {
logger.info(`${SocketActionTypes.PEER_CONNECTED}: ${payload}`)
logger.info(`${SocketActionTypes.PEER_CONNECTED}`, payload)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a formatting issue.

@@ -158,7 +158,7 @@ export class SocketService extends EventEmitter implements OnModuleInit {
socket.on(
SocketActionTypes.CREATE_COMMUNITY,
async (payload: InitCommunityPayload, callback: (response: Community | undefined) => void) => {
this.logger.info(`Creating community ${payload.id}`)
this.logger.info(`Creating community`, payload.id)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another formatting thing

@@ -699,7 +699,6 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI
if (this.communityId) {
this.serverIoProvider.io.emit(SocketActionTypes.COMMUNITY_LAUNCHED, { id: this.communityId })
this.logger.info('this.libp2pService.connectedPeers', this.libp2pService.connectedPeers)
this.logger.info('this.libp2pservice', this.libp2pService)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was throwing a circular reference error since under the hood the logger is now doing a JSON.stringify on objects.

{!path || !width || !height ? (
<ActivityIndicator size='small' color={defaultTheme.palette.main.brand} />
) : (
<TouchableWithoutFeedback onPress={() => openImagePreview(media)}>
<FastImage source={{ uri: `file://${path}` }} style={{ maxWidth, aspectRatio: width / height }} />
<View>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix for displaying images. Turns out TouchableWithoutFeedback doesn't like when child objects aren't wrapped in a view.

const maxWidth = width && width >= 400 ? 400 : width

return (
<View>
<View style={{ padding: 5 }}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just to clean up the appearance of images a little bit.

@islathehut
Copy link
Collaborator Author

I tested with various image sizes and on jpeg, png and gif, all work as expected now.

@islathehut islathehut merged commit 360bfa9 into develop May 20, 2024
25 of 30 checks passed
@islathehut islathehut deleted the fix2526-images-errors-mobile branch May 20, 2024 14:02
islathehut pushed a commit that referenced this pull request May 20, 2024
* Fix images on ios and clean up some logging

* Update changelogs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants