Removing the about section title + Fix notification tap crash (#778)

* Removing the about section title

updated tests

* fixed a bug that made the app crash when tapping

a notification in an unhandled state

* missing screenshots
This commit is contained in:
Mauro
2023-04-06 18:40:27 +02:00
committed by GitHub
parent ed974915a4
commit 2d8c0b9e21
16 changed files with 74 additions and 44 deletions

View File

@@ -476,7 +476,7 @@ extension AppCoordinator: NotificationManagerDelegate {
return
}
userSessionFlowCoordinator?.tryDisplayingRoomScreen(roomId: content.threadIdentifier)
userSessionFlowCoordinator?.handleAppRoute(.room(roomID: content.threadIdentifier))
}
func handleInlineReply(_ service: NotificationManagerProtocol, content: UNNotificationContent, replyText: String) async {

View File

@@ -0,0 +1,21 @@
//
// Copyright 2023 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
enum AppRoute {
case room(roomID: String)
}

View File

@@ -33,9 +33,7 @@ struct RoomDetailsScreen: View {
aboutSection
}
if context.viewState.isEncrypted {
securitySection
}
securitySection
if let recipient = context.viewState.dmRecipient {
ignoreUserSection(user: recipient)
@@ -134,31 +132,31 @@ struct RoomDetailsScreen: View {
.foregroundColor(.element.primaryContent)
.accessibilityIdentifier(A11yIdentifiers.roomDetailsScreen.people)
.disabled(context.viewState.isLoadingMembers)
} header: {
Text(L10n.commonAbout)
.formSectionHeader()
}
.formSectionStyle()
}
@ViewBuilder
private var securitySection: some View {
Section {
Label {
VStack(alignment: .leading, spacing: 2) {
Text(L10n.screenRoomDetailsEncryptionEnabledTitle)
Text(L10n.screenRoomDetailsEncryptionEnabledSubtitle)
.foregroundColor(.element.secondaryContent)
.font(.element.footnote)
if context.viewState.isEncrypted {
Section {
Label {
VStack(alignment: .leading, spacing: 2) {
Text(L10n.screenRoomDetailsEncryptionEnabledTitle)
Text(L10n.screenRoomDetailsEncryptionEnabledSubtitle)
.foregroundColor(.element.secondaryContent)
.font(.element.footnote)
}
} icon: {
Image(systemName: "lock.shield")
}
} icon: {
Image(systemName: "lock.shield")
.labelStyle(FormRowLabelStyle(alignment: .top))
} header: {
Text(L10n.commonSecurity)
.formSectionHeader()
}
.labelStyle(FormRowLabelStyle(alignment: .top))
} header: {
Text(L10n.commonSecurity)
.formSectionHeader()
.formSectionStyle()
}
.formSectionStyle()
}
private var leaveRoomSection: some View {

View File

@@ -62,8 +62,17 @@ class UserSessionFlowCoordinator: CoordinatorProtocol {
stateMachine.isDisplayingRoomScreen(withRoomId: roomId)
}
func tryDisplayingRoomScreen(roomId: String) {
stateMachine.processEvent(.selectRoom(roomId: roomId))
func handleAppRoute(_ appRoute: AppRoute) {
switch stateMachine.state {
case .feedbackScreen, .sessionVerificationScreen, .settingsScreen, .startChatScreen:
navigationSplitCoordinator.setSheetCoordinator(nil)
case .roomList, .initial:
break
}
switch appRoute {
case .room(let roomID):
stateMachine.processEvent(.selectRoom(roomId: roomID))
}
}
// MARK: - Private

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5f9d688c774c2679d1983fd8037dc7debaa0bbd28f7f650b1514217c260716e
size 93293
oid sha256:d8dc5290ca66f80d4dc4dd29a710900436d22d2769bbbee627edac08f6ec2fe7
size 91846

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b75ac39d2873f3f3fe9bda9a9a3633a560362ee80033d096b729e45016e27c92
size 118161
oid sha256:dc13ff8cd8e0c43adab1851d2f1949cfb2f28c9f677c184bd9b95781b211a800
size 112715

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:033280d48071d0b5a854644014137a00214e2bfe485c036f0fe4447176523224
size 115555
oid sha256:ebb283b4d6ec4b1e30c7bc01c5739c2e8e9b953df11f3896e3da1cb37b58cfad
size 112688

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b5d36a079c35934f91cfa81e1f2a567571cd0c66ff32babb3f83d8aa15ff3afb
size 122338
oid sha256:99f9a46a131e99939687a82a67933d27e28aa6a2f0cbf43a7b445e132e914bf2
size 124688

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c3177c3e71c57b6ae7fc1d7e9cc8605e56c57d975d5d4005d3f11332388e93a
size 150100
oid sha256:9d5446fdae425126ded77944453319630d024392c885ada9f1666aa770f5a707
size 143708

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d16839e452b90d87b40115a9a544c83c90f50c18d5ea35e0f281f25dc8f8c34b
size 107317
oid sha256:b92f9049ce37ca4ce10886b2ce4a81716c392fca7cfcd63df9669b3f94c2a7af
size 104736

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ffdfd356bf1aac98e8e8d7954c408708863ff0baf1735b5e5f2601666f89064
size 133654
oid sha256:db16ea2b9d9be2e6da949a7a96bbecd15a861498c6cea8463a45356edbd691bd
size 126070

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a495a6a59176c4bf9899c5f681b80d01896e01bdb362669a1395bf9c5e610133
size 144412
oid sha256:13abe117809fd725937f78aeb7ccd706cd548e3f4887606c7e1b76872f3a98cd
size 142700

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb47ad82f2952d130e17fe3c99871e83782bc573f01317fcd55cf1ffbf53f0f0
size 154477
oid sha256:6ac11000d5f7b037570a6040e5d46a15aa7050ef7f18e6ea57ceb57b0989ae66
size 330389

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:39ab4130f4662ba11b3bdc5efb0a257b5f30ae73047c86201dffd78473a7618b
size 183006
oid sha256:08a7d1ff7eaef9577afad4e51032d853ff2ec6f316d77fb710a7e4e10a269554
size 173343

1
changelog.d/777.change Normal file
View File

@@ -0,0 +1 @@
Removed the about title copy from the people section.

1
changelog.d/779.bugfix Normal file
View File

@@ -0,0 +1 @@
Fixed a bug that crashed the app when tapping on push notifications while the app was in some specific unhandled screens.