ipn: make Notify.Prefs be a *ipn.PrefsView
It is currently a `ipn.PrefsView` which means when we do a JSON roundtrip,
we go from an invalid Prefs to a valid one.
This makes it a pointer, which fixes the JSON roundtrip.
This was introduced in 0957bc5af2.
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
+4
-2
@@ -22,7 +22,8 @@ func (b *FakeBackend) Start(opts Options) error {
|
||||
}
|
||||
nl := NeedsLogin
|
||||
if b.notify != nil {
|
||||
b.notify(Notify{Prefs: opts.Prefs.View()})
|
||||
p := opts.Prefs.View()
|
||||
b.notify(Notify{Prefs: &p})
|
||||
b.notify(Notify{State: &nl})
|
||||
}
|
||||
return nil
|
||||
@@ -83,7 +84,8 @@ func (b *FakeBackend) SetPrefs(new *Prefs) {
|
||||
}
|
||||
|
||||
if b.notify != nil {
|
||||
b.notify(Notify{Prefs: new.View()})
|
||||
p := new.View()
|
||||
b.notify(Notify{Prefs: &p})
|
||||
}
|
||||
if new.WantRunning && !b.live {
|
||||
b.newState(Starting)
|
||||
|
||||
Reference in New Issue
Block a user