-
Notifications
You must be signed in to change notification settings - Fork 86
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
Conversation
Fixes #2526 |
@@ -39,6 +39,8 @@ | |||
<false/> |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 }}> |
There was a problem hiding this comment.
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.
I tested with various image sizes and on jpeg, png and gif, all work as expected now. |
* Fix images on ios and clean up some logging * Update changelogs
FastImage
in a view to fix issue when used withTouchableWithoutFeedback
info.plist
to allow access to files/photosPull Request Checklist
(Optional) Mobile checklist
Please ensure you completed the following checks if you did any changes to the mobile package: