mirror of
https://github.com/ProtonMail/protoncore_android.git
synced 2026-05-15 09:50:41 +00:00
feat(label): Added LabelRepository updateLabelIsExpanded.
This commit is contained in:
@@ -474,6 +474,7 @@ public final class me/proton/core/label/data/repository/LabelRepositoryImpl : me
|
||||
public fun markAsStale (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;)V
|
||||
public fun observeLabels (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;Z)Lkotlinx/coroutines/flow/Flow;
|
||||
public fun updateLabel (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/Label;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public fun updateLabelIsExpanded (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;Lme/proton/core/label/domain/entity/LabelId;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class me/proton/core/label/data/repository/LabelRepositoryImpl_Factory : dagger/internal/Factory {
|
||||
|
||||
@@ -99,6 +99,11 @@ class LabelRepositoryImpl @Inject constructor(
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun updateLabelIsExpanded(userId: UserId, type: LabelType, labelId: LabelId, isExpanded: Boolean) {
|
||||
val label = requireNotNull(getLabel(userId, type, labelId))
|
||||
updateLabel(userId, label.copy(isExpanded = isExpanded))
|
||||
}
|
||||
|
||||
override suspend fun deleteLabel(userId: UserId, type: LabelType, labelId: LabelId) {
|
||||
localDataSource.deleteLabel(userId, listOf(labelId))
|
||||
// Replace any existing [Update|Delete]LabelWorker.
|
||||
|
||||
@@ -146,6 +146,7 @@ public abstract interface class me/proton/core/label/domain/repository/LabelRepo
|
||||
public abstract fun markAsStale (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;)V
|
||||
public abstract fun observeLabels (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;Z)Lkotlinx/coroutines/flow/Flow;
|
||||
public abstract fun updateLabel (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/Label;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public abstract fun updateLabelIsExpanded (Lme/proton/core/domain/entity/UserId;Lme/proton/core/label/domain/entity/LabelType;Lme/proton/core/label/domain/entity/LabelId;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class me/proton/core/label/domain/repository/LabelRepository$DefaultImpls {
|
||||
|
||||
+6
-1
@@ -48,10 +48,15 @@ interface LabelRepository {
|
||||
suspend fun createLabel(userId: UserId, label: NewLabel)
|
||||
|
||||
/**
|
||||
* Update label for [userId], locally, then remotely in background.
|
||||
* Update [Label] for [userId], locally, then remotely in background.
|
||||
*/
|
||||
suspend fun updateLabel(userId: UserId, label: Label)
|
||||
|
||||
/**
|
||||
* Update [Label.isExpanded] for [userId], locally, then remotely in background.
|
||||
*/
|
||||
suspend fun updateLabelIsExpanded(userId: UserId, type: LabelType, labelId: LabelId, isExpanded: Boolean)
|
||||
|
||||
/**
|
||||
* Delete label for [userId] by [labelId], locally, then remotely in background.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user