mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Keep the incoming share displayed when the current account is signed out
The incoming share was displayed in the logged in flow of the current session, so it was destroyed when the current session was signed out, for instance from another device. When another session was signed out, the room select screen was kept and displayed an error if this session was selected. To make the behavior consistent: - The incoming share is now displayed by the RootFlowNode, on top of the logged in flow, and does not depend on a session anymore. The latest used session is passed from the RootFlowNode to the room select screen, through the share flow, and is used as its initial session. - When the root of the RootFlowNode backstack changes while an incoming share is displayed, the new root is set below the incoming share, using the new replaceRoot backstack operation, instead of removing all the elements. - The room select screen handles the invalidation of the current session like for any other session. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+15
-3
@@ -16,7 +16,14 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
|
||||
interface ShareEntryPoint : FeatureEntryPoint {
|
||||
data class Params(val shareIntentData: ShareIntentData)
|
||||
/**
|
||||
* @param sessionId the session to use initially. The user can select another session.
|
||||
* @param shareIntentData the data to share.
|
||||
*/
|
||||
data class Params(
|
||||
val sessionId: SessionId,
|
||||
val shareIntentData: ShareIntentData,
|
||||
)
|
||||
|
||||
fun createNode(
|
||||
parentNode: Node,
|
||||
@@ -27,10 +34,15 @@ interface ShareEntryPoint : FeatureEntryPoint {
|
||||
|
||||
interface Callback : Plugin {
|
||||
/**
|
||||
* Called when the share is done, or cancelled.
|
||||
* Called when the data has been shared.
|
||||
* @param sessionId the session which has been used to share the data. It can be different from the current session.
|
||||
* @param roomIds the rooms the data has been shared to, empty if the share has been cancelled.
|
||||
* @param roomIds the rooms the data has been shared to.
|
||||
*/
|
||||
fun onDone(sessionId: SessionId, roomIds: List<RoomId>)
|
||||
|
||||
/**
|
||||
* Called when the user cancels the share.
|
||||
*/
|
||||
fun onCancel()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user