drafts: Refactor function to have a default value for its 1 parameter.

For function `filter_drafts_by_compose_box_and_recipient` since the set
of drafts to filter from is almost definitely going to always be all
drafts, we make the required drafts parameter optional with the default
value of all drafts.

This is a prep commit for the next commit which will use this function.
This commit is contained in:
N-Shar-ma
2024-02-20 11:51:15 +05:30
committed by Tim Abbott
parent d491c7d53c
commit 6ec04c2469

View File

@@ -429,7 +429,7 @@ export function current_recipient_data(): {
}
export function filter_drafts_by_compose_box_and_recipient(
drafts: Record<string, LocalStorageDraft>,
drafts = draft_model.get(),
): Record<string, LocalStorageDraft> {
const {stream_name, topic, private_recipients} = current_recipient_data();
const stream_id = stream_name ? stream_data.get_stream_id(stream_name) : undefined;