Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ fun AddRemoveTagsScreen(
.padding(horizontal = dimensions().spacing16x)
.height(dimensions().groupButtonHeight)
) {
val shouldDisabledSaveButton =
isLoading || addRemoveTagsViewModel.initialTags == addRemoveTagsViewModel.addedTags.collectAsState().value
WirePrimaryButton(
text = stringResource(R.string.save_label),
onClick = {
addRemoveTagsViewModel.updateTags()
},
state = if (isLoading) WireButtonState.Disabled else WireButtonState.Default,
state = if (shouldDisabledSaveButton) WireButtonState.Disabled else WireButtonState.Default,
loading = isLoading,
clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true),
)
Expand Down Expand Up @@ -188,6 +190,7 @@ fun AddRemoveTagsScreenContent(
errorText = stringResource(R.string.invalid_tag_name_error),
withStartPadding = true
)

else -> WireTextFieldState.Default
},
trailingIcon = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class AddRemoveTagsViewModel @Inject constructor(

private val allTags: MutableStateFlow<Set<String>> = MutableStateFlow(emptySet())

val initialTags: Set<String> = navArgs.tags.toSet()
private val _addedTags: MutableStateFlow<Set<String>> = MutableStateFlow(navArgs.tags.toSet())
internal val addedTags = _addedTags.asStateFlow()

Expand Down