only http for the url previews

This commit is contained in:
Vitor Pamplona
2026-03-07 11:08:38 -05:00
parent 109a5e7cd7
commit 5e1a193f78
2 changed files with 4 additions and 3 deletions
@@ -79,7 +79,7 @@ object CachedUrlParser {
cached
} else {
val urlSet = UrlParser().parseValidUrls(content)
val newUrls = urlSet.withScheme.toList() + urlSet.withoutScheme.map { "http://$it" }
val newUrls = urlSet.withScheme.filter { it.startsWith("http") } + urlSet.withoutScheme.map { "http://$it" }
parsedUrlsCache.put(key, newUrls)
newUrls
}
@@ -39,8 +39,9 @@ class PreviewState {
val results =
source
.debounce(500)
.map { CachedUrlParser.parseValidUrls(it.text) }
.distinctUntilChanged()
.map {
CachedUrlParser.parseValidUrls(it.text)
}.distinctUntilChanged()
.flowOn(Dispatchers.IO)
fun reset() {