core, mobile: prohibit to change chat item expiration when chat is stopped (#2210)

This commit is contained in:
spaced4ndy
2023-04-19 15:21:28 +04:00
committed by GitHub
parent 23ca3dd665
commit 5bf16da09d
3 changed files with 3 additions and 3 deletions
@@ -160,7 +160,7 @@ fun DatabaseLayout(
AppBarTitle(stringResource(R.string.your_chat_database))
SectionView(stringResource(R.string.messages_section_title).uppercase()) {
SectionItemView { TtlOptions(chatItemTTL, enabled = rememberUpdatedState(!progressIndicator && !chatDbChanged), onChatItemTTLSelected) }
SectionItemView { TtlOptions(chatItemTTL, enabled = rememberUpdatedState(!stopped && !progressIndicator), onChatItemTTLSelected) }
}
SectionTextFooter(
remember(currentUser?.displayName) {
@@ -77,7 +77,7 @@ struct DatabaseView: View {
}
}
.frame(height: 36)
.disabled(m.chatDbChanged || progressIndicator)
.disabled(stopped || progressIndicator)
} header: {
Text("Messages")
} footer: {
+1 -1
View File
@@ -939,7 +939,7 @@ processChatCommand = \case
CRServerTestResult user srv <$> withAgent (\a -> testProtocolServer a (aUserId user) server)
TestProtoServer srv -> withUser $ \User {userId} ->
processChatCommand $ APITestProtoServer userId srv
APISetChatItemTTL userId newTTL_ -> withUser' $ \user -> do
APISetChatItemTTL userId newTTL_ -> withUser $ \user -> do
checkSameUser userId user
checkStoreNotChanged $
withChatLock "setChatItemTTL" $ do