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

Refactor task data handler to use TaskId as key instead of Task. #3009

Open
github-actions bot opened this issue Jan 16, 2025 · 0 comments
Open

Refactor task data handler to use TaskId as key instead of Task. #3009

github-actions bot opened this issue Jan 16, 2025 · 0 comments
Assignees

Comments

@github-actions
Copy link

github-actions bot commented Jan 16, 2025

// TODO: Refactor task data handler to use TaskId as key instead of Task.
// Issue URL: https://github.com/google/ground-android/issues/3009


   * @param task The [Task] to retrieve data for.
   * @return The [TaskData] associated with the task, or `null` if no data is found.
   */
  @Deprecated("Use getData(taskId: String) instead")
  fun getData(task: Task): TaskData? = _dataState.value[task]

  // TODO: Refactor task data handler to use TaskId as key instead of Task.
  // Issue URL: https://github.com/google/ground-android/issues/3009
  fun getData(taskId: String): TaskData? =
    _dataState.value.filterKeys { it.id == taskId }.values.firstOrNull()

  /**
   * Returns a [TaskSelections] map representing the current state of task data.
   *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant