Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MVP Share UI as designed #6

Merged
merged 11 commits into from
Nov 25, 2021
Merged

Implement MVP Share UI as designed #6

merged 11 commits into from
Nov 25, 2021

Conversation

grote
Copy link
Collaborator

@grote grote commented Nov 12, 2021

No description provided.

@grote grote requested a review from akwizgran November 12, 2021 20:08
}
return FilesAdded(existingFiles + files)
}

fun zipFiles(state: FilesAdded): FilesReadyForDownload {
fun zipFiles(files: List<SendFile>, ensureActive: () -> Unit): FilesReadyForDownload {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than passing a lambda that wraps the coroutine scope's ensureActive() method, I wonder if it might be clearer to pass the coroutine scope and call its ensureActive() method explicitly? I think that would make it more obvious that the lambda is expected to throw CancellationException to break the loop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is actually how it was before. I had changed it, because I found it a bit strange to hand over coroutine contexts in a function, but maybe that's fine.

What might be better and seems to be possible is using currentCoroutineContext().ensureActive() which can be done when we make this a suspend function.

@akwizgran akwizgran self-requested a review November 19, 2021 14:13
@grote grote merged commit 5535515 into onionshare:main Nov 25, 2021
@grote grote deleted the share-ui branch November 25, 2021 15:55
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