mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Tweak the flow for disabling key storage. (#3464)
* Refactor RoundedLabelItem into the Compound VisualListItem component. * Update the design of SecureBackupKeyBackupScreen. * Add a hint to the key storage toggle when disabled.
This commit is contained in:
@@ -861,7 +861,6 @@
|
|||||||
BC7CA1379D7C24F47B1B8B7E /* PaginationIndicatorRoomTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7F7A975514E850A834B29F /* PaginationIndicatorRoomTimelineView.swift */; };
|
BC7CA1379D7C24F47B1B8B7E /* PaginationIndicatorRoomTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E7F7A975514E850A834B29F /* PaginationIndicatorRoomTimelineView.swift */; };
|
||||||
BCC864190651B3A3CF51E4DF /* MediaFileHandleProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEC1D382565A4E9CAC2F14EA /* MediaFileHandleProxy.swift */; };
|
BCC864190651B3A3CF51E4DF /* MediaFileHandleProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEC1D382565A4E9CAC2F14EA /* MediaFileHandleProxy.swift */; };
|
||||||
BD0BE20DBCE31253AE4490A1 /* RoomListFiltersEmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1DDB2293A51EA4C2739351 /* RoomListFiltersEmptyStateView.swift */; };
|
BD0BE20DBCE31253AE4490A1 /* RoomListFiltersEmptyStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1DDB2293A51EA4C2739351 /* RoomListFiltersEmptyStateView.swift */; };
|
||||||
BD11E639CF566A9DA8FCA717 /* RoundedLabelItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */; };
|
|
||||||
BD6685592716CA957D7BAAC4 /* RoomChangeRolesScreenSelectedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9B45D584D232CB9E5C7734 /* RoomChangeRolesScreenSelectedItem.swift */; };
|
BD6685592716CA957D7BAAC4 /* RoomChangeRolesScreenSelectedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9B45D584D232CB9E5C7734 /* RoomChangeRolesScreenSelectedItem.swift */; };
|
||||||
BD782053BE4C3D2F0BDE5699 /* ServiceLocator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F95CADD0A5DBD76B990FCB /* ServiceLocator.swift */; };
|
BD782053BE4C3D2F0BDE5699 /* ServiceLocator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57F95CADD0A5DBD76B990FCB /* ServiceLocator.swift */; };
|
||||||
BDA68E8D95B2B24B28825B8B /* LoginScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C368CAB3063EF275357ECD4 /* LoginScreenViewModel.swift */; };
|
BDA68E8D95B2B24B28825B8B /* LoginScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C368CAB3063EF275357ECD4 /* LoginScreenViewModel.swift */; };
|
||||||
@@ -1073,6 +1072,7 @@
|
|||||||
EEAE954289DE813A61656AE0 /* LayoutDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C14D83B2B7CD5501A0089EFC /* LayoutDirection.swift */; };
|
EEAE954289DE813A61656AE0 /* LayoutDirection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C14D83B2B7CD5501A0089EFC /* LayoutDirection.swift */; };
|
||||||
EEB9C1555C63B93CA9C372C2 /* EmojiPickerScreenHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B5E29E9A22F45534FBD5B58 /* EmojiPickerScreenHeaderView.swift */; };
|
EEB9C1555C63B93CA9C372C2 /* EmojiPickerScreenHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B5E29E9A22F45534FBD5B58 /* EmojiPickerScreenHeaderView.swift */; };
|
||||||
EEC40663922856C65D1E0DF5 /* KeychainControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB9C37196A4C79F24CE80C6 /* KeychainControllerTests.swift */; };
|
EEC40663922856C65D1E0DF5 /* KeychainControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDB9C37196A4C79F24CE80C6 /* KeychainControllerTests.swift */; };
|
||||||
|
EED33AFD9334EFD7398707A6 /* VisualListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD529C89924EE32CE307F36F /* VisualListItem.swift */; };
|
||||||
EF0D0155DD104C7A41A2EB0E /* PlainMentionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE78FA0011E07920AE83135 /* PlainMentionBuilder.swift */; };
|
EF0D0155DD104C7A41A2EB0E /* PlainMentionBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE78FA0011E07920AE83135 /* PlainMentionBuilder.swift */; };
|
||||||
EF47D802A404A53F15D5D4B6 /* JoinRoomScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7C0A2750998C2D77AD00F /* JoinRoomScreenViewModel.swift */; };
|
EF47D802A404A53F15D5D4B6 /* JoinRoomScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1CD7C0A2750998C2D77AD00F /* JoinRoomScreenViewModel.swift */; };
|
||||||
EF5009AC03212227131C8AF2 /* RoomNotificationSettingsProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E55B5EA766E89FF1F87C3ACB /* RoomNotificationSettingsProxyProtocol.swift */; };
|
EF5009AC03212227131C8AF2 /* RoomNotificationSettingsProxyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E55B5EA766E89FF1F87C3ACB /* RoomNotificationSettingsProxyProtocol.swift */; };
|
||||||
@@ -1958,6 +1958,7 @@
|
|||||||
ACD7BD6BEE21264F6677904A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
ACD7BD6BEE21264F6677904A /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||||
AD0FF64B0E6470F66F42E182 /* EstimatedWaveformView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EstimatedWaveformView.swift; sourceTree = "<group>"; };
|
AD0FF64B0E6470F66F42E182 /* EstimatedWaveformView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EstimatedWaveformView.swift; sourceTree = "<group>"; };
|
||||||
AD378D580A41E42560C60E9C /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Localizable.strings; sourceTree = "<group>"; };
|
AD378D580A41E42560C60E9C /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||||
|
AD529C89924EE32CE307F36F /* VisualListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisualListItem.swift; sourceTree = "<group>"; };
|
||||||
AD558A898847C179E4B7A237 /* SecureBackupKeyBackupScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupKeyBackupScreen.swift; sourceTree = "<group>"; };
|
AD558A898847C179E4B7A237 /* SecureBackupKeyBackupScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupKeyBackupScreen.swift; sourceTree = "<group>"; };
|
||||||
AD6B522BD637845AB9570B10 /* RoomNotificationSettingsProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsProxy.swift; sourceTree = "<group>"; };
|
AD6B522BD637845AB9570B10 /* RoomNotificationSettingsProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsProxy.swift; sourceTree = "<group>"; };
|
||||||
AD6E082B0507FB28F966516A /* CallNotificationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallNotificationRoomTimelineView.swift; sourceTree = "<group>"; };
|
AD6E082B0507FB28F966516A /* CallNotificationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallNotificationRoomTimelineView.swift; sourceTree = "<group>"; };
|
||||||
@@ -2175,7 +2176,6 @@
|
|||||||
DCF239C619971FDE48132550 /* SecureBackupLogoutConfirmationScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupLogoutConfirmationScreenModels.swift; sourceTree = "<group>"; };
|
DCF239C619971FDE48132550 /* SecureBackupLogoutConfirmationScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackupLogoutConfirmationScreenModels.swift; sourceTree = "<group>"; };
|
||||||
DD97F9661ABF08CE002054A2 /* AppLockServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceTests.swift; sourceTree = "<group>"; };
|
DD97F9661ABF08CE002054A2 /* AppLockServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceTests.swift; sourceTree = "<group>"; };
|
||||||
DE5127D6EA05B2E45D0A7D59 /* JoinRoomScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenViewModelTests.swift; sourceTree = "<group>"; };
|
DE5127D6EA05B2E45D0A7D59 /* JoinRoomScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenViewModelTests.swift; sourceTree = "<group>"; };
|
||||||
DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedLabelItem.swift; sourceTree = "<group>"; };
|
|
||||||
DEC1D382565A4E9CAC2F14EA /* MediaFileHandleProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaFileHandleProxy.swift; sourceTree = "<group>"; };
|
DEC1D382565A4E9CAC2F14EA /* MediaFileHandleProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaFileHandleProxy.swift; sourceTree = "<group>"; };
|
||||||
DF05DA24F71B455E8EFEBC3B /* SessionVerificationViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationViewModelTests.swift; sourceTree = "<group>"; };
|
DF05DA24F71B455E8EFEBC3B /* SessionVerificationViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationViewModelTests.swift; sourceTree = "<group>"; };
|
||||||
DF17EA323AD0205A6AB621AA /* Snapshotting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Snapshotting.swift; sourceTree = "<group>"; };
|
DF17EA323AD0205A6AB621AA /* Snapshotting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Snapshotting.swift; sourceTree = "<group>"; };
|
||||||
@@ -2974,9 +2974,9 @@
|
|||||||
1627F2D56477BD331F6D732C /* RoomHeaderView.swift */,
|
1627F2D56477BD331F6D732C /* RoomHeaderView.swift */,
|
||||||
7EB58E4E8D6D634C246AD5C2 /* RoomInviterLabel.swift */,
|
7EB58E4E8D6D634C246AD5C2 /* RoomInviterLabel.swift */,
|
||||||
839E2C35DF3F9C7B54C3CE49 /* RoundedCornerShape.swift */,
|
839E2C35DF3F9C7B54C3CE49 /* RoundedCornerShape.swift */,
|
||||||
DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */,
|
|
||||||
AEB5FF7A09B79B0C6B528F7C /* SFNumberedListView.swift */,
|
AEB5FF7A09B79B0C6B528F7C /* SFNumberedListView.swift */,
|
||||||
E10DA51DBC8C7E1460DBCCBD /* UserProfileListRow.swift */,
|
E10DA51DBC8C7E1460DBCCBD /* UserProfileListRow.swift */,
|
||||||
|
AD529C89924EE32CE307F36F /* VisualListItem.swift */,
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -6856,7 +6856,6 @@
|
|||||||
B272E5D1DE8BDA87A6B7A696 /* RoomTimelineProviderMock.swift in Sources */,
|
B272E5D1DE8BDA87A6B7A696 /* RoomTimelineProviderMock.swift in Sources */,
|
||||||
77D7DAA41AAB36800C1F2E2D /* RoomTimelineProviderProtocol.swift in Sources */,
|
77D7DAA41AAB36800C1F2E2D /* RoomTimelineProviderProtocol.swift in Sources */,
|
||||||
B2F8E01ABA1BA30265B4ECBE /* RoundedCornerShape.swift in Sources */,
|
B2F8E01ABA1BA30265B4ECBE /* RoundedCornerShape.swift in Sources */,
|
||||||
BD11E639CF566A9DA8FCA717 /* RoundedLabelItem.swift in Sources */,
|
|
||||||
50C90117FE25390BFBD40173 /* RustTracing.swift in Sources */,
|
50C90117FE25390BFBD40173 /* RustTracing.swift in Sources */,
|
||||||
D43F0503EF2CBC55272538FE /* SDKGeneratedMocks.swift in Sources */,
|
D43F0503EF2CBC55272538FE /* SDKGeneratedMocks.swift in Sources */,
|
||||||
88CBF1595E39CE697928DE48 /* SFNumberedListView.swift in Sources */,
|
88CBF1595E39CE697928DE48 /* SFNumberedListView.swift in Sources */,
|
||||||
@@ -7053,6 +7052,7 @@
|
|||||||
1A83DD22F3E6F76B13B6E2F9 /* VideoRoomTimelineItemContent.swift in Sources */,
|
1A83DD22F3E6F76B13B6E2F9 /* VideoRoomTimelineItemContent.swift in Sources */,
|
||||||
2CA61BB208CD82EBDB58CD13 /* VideoRoomTimelineView.swift in Sources */,
|
2CA61BB208CD82EBDB58CD13 /* VideoRoomTimelineView.swift in Sources */,
|
||||||
6FC10A00D268FCD48B631E37 /* ViewFrameReader.swift in Sources */,
|
6FC10A00D268FCD48B631E37 /* ViewFrameReader.swift in Sources */,
|
||||||
|
EED33AFD9334EFD7398707A6 /* VisualListItem.swift in Sources */,
|
||||||
1318721F4E5F307586D98112 /* VoiceMessageButton.swift in Sources */,
|
1318721F4E5F307586D98112 /* VoiceMessageButton.swift in Sources */,
|
||||||
4681820102DAC8BA586357D4 /* VoiceMessageCache.swift in Sources */,
|
4681820102DAC8BA586357D4 /* VoiceMessageCache.swift in Sources */,
|
||||||
4F2DF6138E87A4B8C2488CA3 /* VoiceMessageCacheProtocol.swift in Sources */,
|
4F2DF6138E87A4B8C2488CA3 /* VoiceMessageCacheProtocol.swift in Sources */,
|
||||||
|
|||||||
+13
-13
@@ -24,11 +24,11 @@ enum ListPosition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RoundedLabelItem<Icon: View>: View {
|
struct VisualListItem<Icon: View>: View {
|
||||||
@Environment(\.backgroundStyle) private var backgroundStyle
|
@Environment(\.backgroundStyle) private var backgroundStyle
|
||||||
|
|
||||||
let title: String
|
let title: String
|
||||||
let listPosition: ListPosition
|
let position: ListPosition
|
||||||
let iconContent: () -> Icon
|
let iconContent: () -> Icon
|
||||||
|
|
||||||
private var backgroundColor: AnyShapeStyle {
|
private var backgroundColor: AnyShapeStyle {
|
||||||
@@ -39,17 +39,17 @@ struct RoundedLabelItem<Icon: View>: View {
|
|||||||
Label { Text(title) } icon: {
|
Label { Text(title) } icon: {
|
||||||
iconContent()
|
iconContent()
|
||||||
}
|
}
|
||||||
.labelStyle(CheckmarkLabelStyle())
|
.labelStyle(VisualListItemLabelStyle())
|
||||||
.padding(.horizontal, 20)
|
.padding(.horizontal, 16)
|
||||||
.padding(.vertical, 12)
|
.padding(.vertical, 12)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.background(backgroundColor, in: RoundedCornerShape(radius: 16, corners: listPosition.roundedCorners))
|
.background(backgroundColor, in: RoundedCornerShape(radius: 14, corners: position.roundedCorners))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct CheckmarkLabelStyle: LabelStyle {
|
private struct VisualListItemLabelStyle: LabelStyle {
|
||||||
func makeBody(configuration: Configuration) -> some View {
|
func makeBody(configuration: Configuration) -> some View {
|
||||||
HStack(alignment: .top, spacing: 16) {
|
HStack(alignment: .top, spacing: 12) {
|
||||||
configuration.icon
|
configuration.icon
|
||||||
configuration.title
|
configuration.title
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ private struct CheckmarkLabelStyle: LabelStyle {
|
|||||||
|
|
||||||
// MARK: - Previews
|
// MARK: - Previews
|
||||||
|
|
||||||
struct AnalyticsPromptScreenCheckmarkItem_Previews: PreviewProvider, TestablePreview {
|
struct VisualListItem_Previews: PreviewProvider, TestablePreview {
|
||||||
static let strings = AnalyticsPromptScreenStrings(termsURL: ServiceLocator.shared.settings.analyticsConfiguration.termsURL)
|
static let strings = AnalyticsPromptScreenStrings(termsURL: ServiceLocator.shared.settings.analyticsConfiguration.termsURL)
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
@@ -75,17 +75,17 @@ struct AnalyticsPromptScreenCheckmarkItem_Previews: PreviewProvider, TestablePre
|
|||||||
|
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
RoundedLabelItem(title: strings.point1, listPosition: .top) {
|
VisualListItem(title: strings.point1, position: .top) {
|
||||||
testImage1
|
testImage1
|
||||||
}
|
}
|
||||||
RoundedLabelItem(title: strings.point2, listPosition: .middle) {
|
VisualListItem(title: strings.point2, position: .middle) {
|
||||||
testImage2
|
testImage2
|
||||||
}
|
}
|
||||||
RoundedLabelItem(title: "This is a short string.", listPosition: .middle) {
|
VisualListItem(title: "This is a short string.", position: .middle) {
|
||||||
testImage1
|
testImage1
|
||||||
}
|
}
|
||||||
RoundedLabelItem(title: "This is a very long string that will be used to test the layout over multiple lines of text to ensure everything is correct.",
|
VisualListItem(title: "This is a very long string that will be used to test the layout over multiple lines of text to ensure everything is correct.",
|
||||||
listPosition: .bottom) {
|
position: .bottom) {
|
||||||
testImage2
|
testImage2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -70,7 +70,7 @@ struct EncryptionResetScreen: View {
|
|||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func checkMarkItem(title: String, position: ListPosition, positive: Bool) -> some View {
|
private func checkMarkItem(title: String, position: ListPosition, positive: Bool) -> some View {
|
||||||
RoundedLabelItem(title: title, listPosition: position) {
|
VisualListItem(title: title, position: position) {
|
||||||
CompoundIcon(positive ? \.check : \.info)
|
CompoundIcon(positive ? \.check : \.info)
|
||||||
.foregroundColor(positive ? .compound.iconAccentPrimary : .compound.iconSecondary)
|
.foregroundColor(positive ? .compound.iconAccentPrimary : .compound.iconSecondary)
|
||||||
.alignmentGuide(.top) { _ in 2 }
|
.alignmentGuide(.top) { _ in 2 }
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ struct AnalyticsPromptScreen: View {
|
|||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func checkMarkItem(title: String, position: ListPosition) -> some View {
|
private func checkMarkItem(title: String, position: ListPosition) -> some View {
|
||||||
RoundedLabelItem(title: title, listPosition: position) {
|
VisualListItem(title: title, position: position) {
|
||||||
CompoundIcon(\.checkCircle, size: .small, relativeTo: .body)
|
CompoundIcon(\.checkCircle, size: .small, relativeTo: .body)
|
||||||
.foregroundColor(.compound.iconAccentPrimary)
|
.foregroundColor(.compound.iconAccentPrimary)
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-23
@@ -39,37 +39,37 @@ struct SecureBackupKeyBackupScreen: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var disableBackupSection: some View {
|
private var disableBackupSection: some View {
|
||||||
VStack(spacing: 16) {
|
VStack(spacing: 24) {
|
||||||
BigIcon(icon: \.keyOffSolid)
|
VStack(spacing: 16) {
|
||||||
|
BigIcon(icon: \.error, style: .alertSolid)
|
||||||
|
|
||||||
Text(L10n.screenKeyBackupDisableTitle)
|
VStack(spacing: 8) {
|
||||||
.foregroundColor(.compound.textPrimary)
|
Text(L10n.screenKeyBackupDisableTitle)
|
||||||
.font(.compound.headingMDBold)
|
.foregroundColor(.compound.textPrimary)
|
||||||
.multilineTextAlignment(.center)
|
.font(.compound.headingMDBold)
|
||||||
|
.multilineTextAlignment(.center)
|
||||||
|
|
||||||
Text(L10n.screenKeyBackupDisableDescription)
|
Text(L10n.screenKeyBackupDisableDescription)
|
||||||
.foregroundColor(.compound.textSecondary)
|
|
||||||
.font(.compound.bodyMD)
|
|
||||||
.multilineTextAlignment(.center)
|
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
|
||||||
Label {
|
|
||||||
Text(L10n.screenKeyBackupDisableDescriptionPoint1)
|
|
||||||
.foregroundColor(.compound.textSecondary)
|
.foregroundColor(.compound.textSecondary)
|
||||||
.font(.compound.bodyMD)
|
.font(.compound.bodyMD)
|
||||||
} icon: {
|
.multilineTextAlignment(.center)
|
||||||
CompoundIcon(\.close)
|
|
||||||
.foregroundColor(.compound.iconCriticalPrimary)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
Text(L10n.screenKeyBackupDisableDescriptionPoint2(InfoPlistReader.main.bundleDisplayName))
|
VisualListItem(title: L10n.screenKeyBackupDisableDescriptionPoint1,
|
||||||
.foregroundColor(.compound.textSecondary)
|
position: .top) {
|
||||||
.font(.compound.bodyMD)
|
CompoundIcon(\.close, size: .small, relativeTo: .body)
|
||||||
} icon: {
|
|
||||||
CompoundIcon(\.close)
|
|
||||||
.foregroundColor(.compound.iconCriticalPrimary)
|
.foregroundColor(.compound.iconCriticalPrimary)
|
||||||
}
|
}
|
||||||
|
.backgroundStyle(.compound.bgActionSecondaryHovered)
|
||||||
|
|
||||||
|
VisualListItem(title: L10n.screenKeyBackupDisableDescriptionPoint2(InfoPlistReader.main.productionAppName),
|
||||||
|
position: .bottom) {
|
||||||
|
CompoundIcon(\.close, size: .small, relativeTo: .body)
|
||||||
|
.foregroundColor(.compound.iconCriticalPrimary)
|
||||||
|
}
|
||||||
|
.backgroundStyle(.compound.bgActionSecondaryHovered)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -17,6 +17,10 @@ struct SecureBackupScreenViewState: BindableState {
|
|||||||
var recoveryState = SecureBackupRecoveryState.unknown
|
var recoveryState = SecureBackupRecoveryState.unknown
|
||||||
var keyBackupState = SecureBackupKeyBackupState.unknown
|
var keyBackupState = SecureBackupKeyBackupState.unknown
|
||||||
var bindings: SecureBackupScreenViewStateBindings
|
var bindings: SecureBackupScreenViewStateBindings
|
||||||
|
|
||||||
|
var keyStorageToggleDescription: String? {
|
||||||
|
keyBackupState.keyStorageToggleState ? nil : L10n.screenChatBackupKeyStorageDisabledError
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SecureBackupScreenViewStateBindings {
|
struct SecureBackupScreenViewStateBindings {
|
||||||
|
|||||||
+6
-6
@@ -26,7 +26,7 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup
|
|||||||
self.userIndicatorController = userIndicatorController
|
self.userIndicatorController = userIndicatorController
|
||||||
|
|
||||||
super.init(initialViewState: .init(chatBackupDetailsURL: chatBackupDetailsURL,
|
super.init(initialViewState: .init(chatBackupDetailsURL: chatBackupDetailsURL,
|
||||||
bindings: SecureBackupScreenViewStateBindings(keyStorageEnabled: secureBackupController.keyBackupState.value.toggleState)))
|
bindings: SecureBackupScreenViewStateBindings(keyStorageEnabled: secureBackupController.keyBackupState.value.keyStorageToggleState)))
|
||||||
|
|
||||||
secureBackupController.recoveryState
|
secureBackupController.recoveryState
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
@@ -38,7 +38,7 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup
|
|||||||
.sink { [weak self] state in
|
.sink { [weak self] state in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
self.state.keyBackupState = state
|
self.state.keyBackupState = state
|
||||||
self.state.bindings.keyStorageEnabled = state.toggleState
|
self.state.bindings.keyStorageEnabled = state.keyStorageToggleState
|
||||||
}
|
}
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
}
|
}
|
||||||
@@ -53,10 +53,10 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup
|
|||||||
let keyBackupState = secureBackupController.keyBackupState.value
|
let keyBackupState = secureBackupController.keyBackupState.value
|
||||||
switch (keyBackupState, enable) {
|
switch (keyBackupState, enable) {
|
||||||
case (.unknown, true):
|
case (.unknown, true):
|
||||||
state.bindings.keyStorageEnabled = keyBackupState.toggleState // Reset the toggle in case enabling fails
|
state.bindings.keyStorageEnabled = keyBackupState.keyStorageToggleState // Reset the toggle in case enabling fails
|
||||||
enableBackup()
|
enableBackup()
|
||||||
case (.enabled, false):
|
case (.enabled, false):
|
||||||
state.bindings.keyStorageEnabled = keyBackupState.toggleState // Reset the toggle in case the user cancels
|
state.bindings.keyStorageEnabled = keyBackupState.keyStorageToggleState // Reset the toggle in case the user cancels
|
||||||
actionsSubject.send(.keyBackup)
|
actionsSubject.send(.keyBackup)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@@ -83,8 +83,8 @@ class SecureBackupScreenViewModel: SecureBackupScreenViewModelType, SecureBackup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension SecureBackupKeyBackupState {
|
extension SecureBackupKeyBackupState {
|
||||||
var toggleState: Bool {
|
var keyStorageToggleState: Bool {
|
||||||
switch self {
|
switch self {
|
||||||
case .unknown, .enabling: false
|
case .unknown, .enabling: false
|
||||||
case .enabled, .disabling: true
|
case .enabled, .disabling: true
|
||||||
|
|||||||
+2
-1
@@ -68,7 +68,8 @@ struct SecureBackupScreen: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var keyStorageToggle: some View {
|
private var keyStorageToggle: some View {
|
||||||
ListRow(label: .plain(title: L10n.screenChatBackupKeyStorageToggleTitle),
|
ListRow(label: .plain(title: L10n.screenChatBackupKeyStorageToggleTitle,
|
||||||
|
description: context.viewState.keyStorageToggleDescription),
|
||||||
kind: .toggle($context.keyStorageEnabled))
|
kind: .toggle($context.keyStorageEnabled))
|
||||||
.onChange(of: context.keyStorageEnabled) { _, newValue in
|
.onChange(of: context.keyStorageEnabled) { _, newValue in
|
||||||
context.send(viewAction: .keyStorageToggled(newValue))
|
context.send(viewAction: .keyStorageToggled(newValue))
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ extension PreviewTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func test_analyticsPromptScreenCheckmarkItem() {
|
|
||||||
for preview in AnalyticsPromptScreenCheckmarkItem_Previews._allPreviews {
|
|
||||||
assertSnapshots(matching: preview)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func test_analyticsPromptScreen() {
|
func test_analyticsPromptScreen() {
|
||||||
for preview in AnalyticsPromptScreen_Previews._allPreviews {
|
for preview in AnalyticsPromptScreen_Previews._allPreviews {
|
||||||
assertSnapshots(matching: preview)
|
assertSnapshots(matching: preview)
|
||||||
@@ -953,6 +947,12 @@ extension PreviewTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func test_visualListItem() {
|
||||||
|
for preview in VisualListItem_Previews._allPreviews {
|
||||||
|
assertSnapshots(matching: preview)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func test_voiceMessageButton() {
|
func test_voiceMessageButton() {
|
||||||
for preview in VoiceMessageButton_Previews._allPreviews {
|
for preview in VoiceMessageButton_Previews._allPreviews {
|
||||||
assertSnapshots(matching: preview)
|
assertSnapshots(matching: preview)
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8b702610b9a43191c4dccee0173300c5c5db9041e60ad9bc581ebfc2a47fcd8a
|
oid sha256:dfb5ef0504933e89135643a41b30ee4d70aa5ecfab0bb20253f50dab03b0db6a
|
||||||
size 519748
|
size 516263
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2151c4124c4f826a9b2b1039ec2cffea1f7f9930e37918ca65558239190c8032
|
oid sha256:95e764b2d91c03d6f6a7c40635fb14a5f2e041ff77419e8e9ef5b42a54060b43
|
||||||
size 545056
|
size 542507
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:76a550baf0bfc5fc2e7d2ccbfdb1e367cd025a3daca8526d4040a46523454869
|
oid sha256:85867b67a34544e7f4e87b2f3aaf0f915f65977c478d8f2d3ba7dc42a80ab200
|
||||||
size 316889
|
size 320240
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8e28e24910ef83b66f273751cb0427e7f6df1ac127bfe6422ca172e7be0819bc
|
oid sha256:7c9c4b6a6b275e412de5ef313c4e435fc5786476404b421ca899a47d07cc9ebf
|
||||||
size 323831
|
size 331190
|
||||||
|
|||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4959f2b957a1fc21cd35b690b5eea1fc9aab9cc84fe13c3a50b3fbecea276e3c
|
|
||||||
size 110926
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4f3d9c02c0c19490c9b1245d86dfdd97468f0cafa8c32bb9d01a62c1dccca6a9
|
|
||||||
size 118558
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:7558f09b10e62a9a111e91fe259f86c3709bf354867b406b23a3a122c67d9d29
|
|
||||||
size 73551
|
|
||||||
-3
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:2bea6d31ae7c93fb10936d2af89bdefa799d2a8d5a314c2d7e351dd817c6bf68
|
|
||||||
size 87505
|
|
||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:b6669bd265a9b14b47f3e80786ce487275a81dd0a7c096bab707fc573d5ca5ba
|
oid sha256:8530b94b6ad2bb808589d221dd963d398a853c218641813235430f51f5d05b3c
|
||||||
size 156868
|
size 155840
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:13eb76a6174949e63d35e260744763a405b7fd4cdfb0405189b647115be04f4d
|
oid sha256:652fe68e0477a949d5d7284de23705a87479741e55ba0ed89a40281d23c31e20
|
||||||
size 212875
|
size 212237
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:e2f9383e9ccde9ed8fda0461051e0c445537c299f3881b2d7feeae084bdb6be4
|
oid sha256:67dc40a01ee89d875ae4723b8809384d5907399d536a26a520489227c3557c83
|
||||||
size 107493
|
size 108502
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:359d2bfea87562d0bce3472e9994180397a2b33315b9d6768439bfbdcc3eb61a
|
oid sha256:33e757ca5012297a0f1a049f0bad15171f2043ee9224dbc148389607a15be8dd
|
||||||
size 164012
|
size 163996
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:2642ca05da869cf59a8c275465b67e43db8d01f7d984543ee4442a1a72fee1c2
|
oid sha256:9534f1649e9fdf3229867cce6594bfdf6fad971c5e3fbb5583da7980e736321a
|
||||||
size 140623
|
size 144792
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:77d646f5b1e3f8377c674eb61b184670ba3e6e5eb26e16644a1271ec75d79cbb
|
oid sha256:5703e4e80055b040382985fd7220c1a57ded04898745b49dfb3232f49ce240be
|
||||||
size 194850
|
size 201719
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:57ba61f6ee8a7d6a382851bfe161d922a8179a58d4ddd191a08eb9891ab8a30b
|
oid sha256:42f867e0fb0b0317b917b87c2bffbd857cd09857549da1246940f125a36b380e
|
||||||
size 98103
|
size 102838
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ea9ca53d25dd7f8fbd4453bca7dc02ffde0fd5bc43c0f183489080c5804fbc7c
|
oid sha256:d08e5521dcb2ebf681fd6a546e0804ad01e74b66063125686d7850d2df28b856
|
||||||
size 153579
|
size 160165
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:248c05bf396932033fdc1f2821659988b6cdde1558c4db1ff2e36c6eef9ae02d
|
oid sha256:3eefb4e846f077a2ca7b8297c505f780e7a604e7f9116b71cd1a9883113ccd0f
|
||||||
size 109322
|
size 117078
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:617075b51396eb2cbaddee74e2673f0b778b04f5f9263c8314dbdde774c6a233
|
oid sha256:f687602f97c449269d2634bed2b9f81a85872b6f88364a96c52521729a222d3a
|
||||||
size 126840
|
size 136021
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:1203fa1008ba94be887f96b286efa557a96577cf30ea0a3f882b9f7576b4c646
|
oid sha256:5306c7452d991aea79d15d23f0b0c5363fd250d0eaf2c2e3a39d0b48b0f7fb7e
|
||||||
size 66212
|
size 73582
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:9199e5915f3292565b67005b242619cf670f07024c7097ab0e7af7bd5bc23710
|
oid sha256:71b3bee5ed6add6cc6e4463be8b9099b47acc6d9c0b40dc26449efe2531d429e
|
||||||
size 89974
|
size 103402
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9cac17036704df924eee98ae0287d231dceedca6ceee8ba990d4acb4d377f678
|
||||||
|
size 110821
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:cd981618a53c74d5f3ee0c4bab370b4e431c760e94f1a97af742e2a82bc25f43
|
||||||
|
size 118491
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a3734c22ad3f2a59633b28043fca8dee4038376e542b043ab05fc00fd93be364
|
||||||
|
size 71605
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c688ca29c8ed4a490f20e081323f4ac300c9addf2a05662cd52d98f312f1b872
|
||||||
|
size 85945
|
||||||
Reference in New Issue
Block a user