Skip to content

Commit d27c080

Browse files
committed
refactor(ResourceViewModel): simplify subscription expression
1 parent d28aac5 commit d27c080

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/src/main/java/org/shirabox/app/ui/activity/resource/ResourceViewModel.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,8 @@ class ResourceViewModel @Inject constructor(@ApplicationContext context: Context
209209
AppDataStore.read(context, DataStoreScheme.FIELD_SUBSCRIPTION.key).firstOrNull()
210210
?: DataStoreScheme.FIELD_SUBSCRIPTION.defaultValue
211211

212-
if(subscriptionAllowed) {
213-
shiraBoxAnime.value?.let {
214-
cachedContent = cachedContent.copy(episodesNotifications = isFavourite.value)
215-
}
212+
shiraBoxAnime.value?.let {
213+
cachedContent = cachedContent.copy(episodesNotifications = isFavourite.value && subscriptionAllowed)
216214
}
217215

218216
db.contentDao().updateContents(cachedContent)

0 commit comments

Comments
 (0)