Skip to content

Commit

Permalink
Fix(2526): Fix images on ios and clean up some logging (#2536)
Browse files Browse the repository at this point in the history
* Fix images on ios and clean up some logging

* Update changelogs
  • Loading branch information
ikoenigsknecht committed May 20, 2024
1 parent 043c082 commit 360bfa9
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

* Disable spellCheck/autoCorrect on non-spelling sensitive fields like usernames and channels ([#373](https://github.com/TryQuiet/quiet/issues/373))
* Fixes issue with reconnecting to peers on resume on iOS ([#2424](https://github.com/TryQuiet/quiet/issues/2424))

* Fixes references to 'invite code' to be 'invite link' in UI ([#2441](https://github.com/TryQuiet/quiet/issues/2441))
* Fixes issue with image messages not displaying/throwing errors on iOS ([#2526](https://github.com/TryQuiet/quiet/issues/2526))

# Chores

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
this.logger.info('this.libp2pService.dialedPeers', this.libp2pService.dialedPeers)
this.serverIoProvider.io.emit(
SocketActionTypes.CONNECTED_PEERS,
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/nest/socket/socket.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
this.emit(SocketActionTypes.CREATE_COMMUNITY, payload, callback)
}
)
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Fixes issue with reconnecting to peers on resume on iOS ([#2424](https://github.com/TryQuiet/quiet/issues/2424))
* Update github workflows for PR gating ([#2487](https://github.com/TryQuiet/quiet/issues/2487))
* Don't create duplicate CSRs when joining a community under certain circumstances ([#2321](https://github.com/TryQuiet/quiet/issues/2321))
* Fixes issue with image messages not displaying/throwing errors on iOS ([#2526](https://github.com/TryQuiet/quiet/issues/2526))

[2.2.0]

Expand Down
12 changes: 12 additions & 0 deletions packages/mobile/ios/Quiet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand All @@ -54,8 +56,16 @@
</dict>
</dict>
</dict>
<key>NSAppleMusicUsageDescription</key>
<string>Quiet uses the document directory for storing files and images sent through the app.</string>
<key>NSDocumentsFolderUsageDescription</key>
<string>Quiet uses the document directory for storing files and images sent through the app.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSPhotoLibraryLimitedAccessAPISupport</key>
<true/>
<key>NSPhotoLibraryUsageDescription</key>
<string>Quiet access photos for sending images through the app.</string>
<key>UIAppFonts</key>
<array>
<string>Rubik-Black.ttf</string>
Expand All @@ -75,6 +85,8 @@
</array>
<key>UIBackgroundModes</key>
<array/>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ import FastImage from 'react-native-fast-image'
export const UploadedImage: FC<UploadedImageProps> = ({ media, openImagePreview }) => {
const { path, width, height } = media

const aspectRatio = width && height ? width / height : undefined
const maxWidth = width && width >= 400 ? 400 : width

return (
<View>
<View style={{ padding: 5 }}>
{!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>
<FastImage source={{ uri: `file://${path}` }} style={{ maxWidth, aspectRatio }} />
</View>
</TouchableWithoutFeedback>
)}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
emit(networkActions.addConnectedPeers(payload.peers))
})
socket.on(SocketActionTypes.PEER_DISCONNECTED, (payload: NetworkDataPayload) => {
Expand Down

0 comments on commit 360bfa9

Please sign in to comment.