KrishKrosh / KrishKrosh/TrackWeight

root owner issue

Open Beginner friendly
#69 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
9.1k
Forks
397
PR merge metrics
No merged PRs in 30d

Description

https://github.com/KrishKrosh/TrackWeight/blob/e322cae241d29afbee2860a6b585e9fe3974bd0c/TrackWeight/SettingsView.swift#L10

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Open TrackWeight/SettingsView.swift at line 10 and inspect how ContentViewModel is provided to SettingsView. Confirm whether SettingsView owns the model or receives it from the environment. The work is done when the view uses the shared environment object and devices and the selected device no longer reset when the view is recreated.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
desktop
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.