X Tutup
Skip to content

Commit e4efef8

Browse files
committed
Add early return for disabled feature in DuckChatDeleter
When duckAiDataClearingFeature is disabled (the default), deleteChat() now returns false immediately instead of spinning up a WebView, loading pages for two domains, injecting JS, and waiting for timeouts that will never complete. This avoids up to ~10 seconds of unnecessary suspended delay per tab burn when the feature is disabled.
1 parent 6e073cd commit e4efef8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/clearing/RealDuckChatDeleter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class RealDuckChatDeleter @Inject constructor(
7272
private var cachedScript: String? = null
7373

7474
override suspend fun deleteChat(chatId: String): Boolean {
75+
if (!duckAiDataClearingFeature.self().isEnabled()) return false
76+
7577
return mutex.withLock {
7678
withContext(dispatchers.main()) {
7779
try {

0 commit comments

Comments
 (0)
X Tutup