correction commit précédent

This commit is contained in:
Laurent Le Houerou 2020-06-23 10:03:14 +04:00
parent 7579a341d5
commit 9bc06cb150

View File

@ -234,10 +234,16 @@ func (a *Arlo) IsConnected() bool {
} }
func (a *Arlo) Subscribe(ctx context.Context) error { func (a *Arlo) Subscribe(ctx context.Context) error {
lastid := ""
if a.eventStream != nil {
lastid = a.eventStream.GetLastId()
}
a.eventStream = newEventStream( a.eventStream = newEventStream(
BaseUrl+fmt.Sprintf(NotifyResponsesPushServiceUri), BaseUrl+fmt.Sprintf(NotifyResponsesPushServiceUri),
&http.Client{Jar: a.client.GetClient().Jar}, &http.Client{Jar: a.client.GetClient().Jar},
a.client.Header.Get("Authorization"), a.client.Header.Get("Authorization"),
lastid,
) )
err := a.eventStream.listen(ctx) err := a.eventStream.listen(ctx)