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 cached
} else { } else {
val urlSet = UrlParser().parseValidUrls(content) 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) parsedUrlsCache.put(key, newUrls)
newUrls newUrls
} }
@@ -39,8 +39,9 @@ class PreviewState {
val results = val results =
source source
.debounce(500) .debounce(500)
.map { CachedUrlParser.parseValidUrls(it.text) } .map {
.distinctUntilChanged() CachedUrlParser.parseValidUrls(it.text)
}.distinctUntilChanged()
.flowOn(Dispatchers.IO) .flowOn(Dispatchers.IO)
fun reset() { fun reset() {