Skip to content

root owner issue #69

Description

@iimofo

@StateObject private var viewModel = ContentViewModel()

If SettingsView is not the root owner of ContentViewModel, this will create a new instance every time the view is recreated.

That means:

  • devices reload unexpectedly
  • selected device resets
  • inconsistent state across app

FIX:
@EnvironmentObject var viewModel: ContentViewModel

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions