Skip to content

Only pass in view models for screens for writable cases. If its read-only, just pass in the object. #2174

Description

@dessalines

Pre-Flight checklist

  • Did you check to see if this issue already exists?
  • This is a single feature request. (Do not put multiple feature requests in one issue)
  • This is not a question or discussion. (Use https://lemmy.ml/c/jerboa for that)

Describe The Feature Request Below

On many of the screens, we pass in large view models, which let you refetch and update data. For example, we pass in the siteViewModel, appSettingsViewModel, and accountViewModel into screens where it shouldn't need to write or update those objects, only read them.

This isn't ideal because:

  • It exposes the objects within as writeable, where many shouldn't be.
  • We then have to observeAsState, whereas in most cases we should only need to have the GetSiteResponse or AppSettings

We should go through every screen in MainActivity.kt, and make sure its only passing the minimum of what it needs.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - low/medium priorityThis issue is not planned to be implemented soonenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions