Skip to content

Commit 6b33612

Browse files
committed
Merge branch 'hotfix/5.243.1'
2 parents c042171 + 9ca08b8 commit 6b33612

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

app/version/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=5.243.0
1+
VERSION=5.243.1

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/RealDuckChat.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,12 @@ class RealDuckChat @Inject constructor(
320320
}
321321

322322
override fun openDuckChatSettings() {
323-
// todo what happens with this interaction? closeDuckChat() would go back to browser activity
324323
val intent = globalActivityStarter.startIntent(context, DuckChatSettingsNoParams)
325324
intent?.flags = Intent.FLAG_ACTIVITY_NEW_TASK
326325
context.startActivity(intent)
327-
closeDuckChat()
326+
appCoroutineScope.launch {
327+
closeChatFlow.emit(Unit)
328+
}
328329
}
329330

330331
override fun closeDuckChat() {

duckchat/duckchat-impl/src/test/kotlin/com/duckduckgo/duckchat/impl/RealDuckChatTest.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,15 @@ class RealDuckChatTest {
414414
fun whenOpenDuckChatSettingsCalledThenGlobalActivityStarterCalledWithDuckChatSettings() = runTest {
415415
whenever(mockGlobalActivityStarter.startIntent(any(), any<ActivityParams>())).thenReturn(Intent())
416416

417+
val testLifecycleOwner = TestLifecycleOwner(initialState = CREATED)
418+
419+
var onCloseCalled = false
420+
testee.observeCloseEvent(testLifecycleOwner) {
421+
onCloseCalled = true
422+
}
423+
424+
testLifecycleOwner.currentState = Lifecycle.State.STARTED
425+
417426
testee.openDuckChatSettings()
418427

419428
verify(mockGlobalActivityStarter).startIntent(mockContext, DuckChatSettingsNoParams)
@@ -424,7 +433,9 @@ class RealDuckChatTest {
424433

425434
assertEquals(Intent.FLAG_ACTIVITY_NEW_TASK, capturedIntent.flags)
426435

427-
verify(testee).closeDuckChat()
436+
advanceUntilIdle()
437+
438+
assertTrue(onCloseCalled)
428439
}
429440

430441
@Test

0 commit comments

Comments
 (0)