mobile: preserve group description in profile (#1658)

This commit is contained in:
Evgeny Poberezkin
2022-12-28 16:59:25 +00:00
committed by GitHub
parent 96ad9faa85
commit 0e6909845f
5 changed files with 13 additions and 4 deletions

View File

@@ -769,6 +769,7 @@ data class GroupInfo (
data class GroupProfile (
override val displayName: String,
override val fullName: String,
val description: String? = null,
override val image: String? = null,
override val localAlias: String = "",
val groupPreferences: GroupPreferences? = null

View File

@@ -136,7 +136,13 @@ fun GroupProfileLayout(
if (enabled) {
Text(
stringResource(R.string.save_group_profile),
modifier = Modifier.clickable { saveProfile(GroupProfile(displayName.value, fullName.value, profileImage.value)) },
modifier = Modifier.clickable {
saveProfile(groupProfile.copy(
displayName = displayName.value,
fullName = fullName.value,
image = profileImage.value
))
},
color = MaterialTheme.colors.primary
)
} else {

View File

@@ -15,7 +15,7 @@
"location" : "https://github.com/kirualex/SwiftyGif",
"state" : {
"branch" : "master",
"revision" : "4a6f5bad863c5365b192f8441f62c713ecff62bd"
"revision" : "5e8619335d394901379c9add5c4c1c2f420b3800"
}
}
],

View File

@@ -44,7 +44,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableUBSanitizer = "YES"
enableAddressSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"

View File

@@ -1364,15 +1364,17 @@ public struct GroupInfo: Identifiable, Decodable, NamedChat {
}
public struct GroupProfile: Codable, NamedChat {
public init(displayName: String, fullName: String, image: String? = nil, groupPreferences: GroupPreferences? = nil) {
public init(displayName: String, fullName: String, description: String? = nil, image: String? = nil, groupPreferences: GroupPreferences? = nil) {
self.displayName = displayName
self.fullName = fullName
self.description = description
self.image = image
self.groupPreferences = groupPreferences
}
public var displayName: String
public var fullName: String
public var description: String?
public var image: String?
public var groupPreferences: GroupPreferences?
public var localAlias: String { "" }