Skip to content

Conversation

MozhganPeivandianSharbaf
Copy link
Contributor

…Invoice

IPC-729

Copy link

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where changing device orientation incorrectly changes the header title to "Your Invoice" instead of maintaining the appropriate screen title. The fix ensures that the displayed screen state is properly preserved across configuration changes.

  • Modified MutableSharedFlow configuration to include replay functionality for better state management
  • Removed manual title setting logic that was causing inconsistent behavior during orientation changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
GiniHealth.kt Added replay parameter to _displayedScreen flow to preserve state across configuration changes
InvoicesActivity.kt Removed manual title setting and back stack management code that was causing orientation issues

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


private val _displayedScreen: MutableSharedFlow<DisplayedScreen> =
MutableSharedFlow(extraBufferCapacity = 1)
MutableSharedFlow(replay = 1, extraBufferCapacity = 1)
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding both replay = 1 and extraBufferCapacity = 1 may be redundant. The replay parameter already provides buffering for the last emitted value. Consider using just replay = 1 unless there's a specific need for additional buffer capacity beyond the replayed value.

Suggested change
MutableSharedFlow(replay = 1, extraBufferCapacity = 1)
MutableSharedFlow(replay = 1)

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@obaidgini obaidgini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants