Prevent displaying my stories page when none are present in viewer.

This commit is contained in:
Alex Hart 2022-02-24 14:29:48 -04:00
parent aae683af41
commit bdf7e5d367

View file

@ -19,7 +19,22 @@ class StoryViewerRepository {
val myStory: RecipientId = SignalDatabase.recipients.getOrInsertFromDistributionListId(DistributionListId.MY_STORY)
listOf(myStory) + doNotCollapse
val myStoriesCount = SignalDatabase.mms.allOutgoingStories.use {
var count = 0
while (it.next != null) {
if (!it.current.recipient.isGroup) {
count++
}
}
count
}
if (myStoriesCount > 0) {
listOf(myStory) + doNotCollapse
} else {
doNotCollapse
}
}.subscribeOn(Schedulers.io())
}
}