Skip to content

Commit

Permalink
Pull request 1901: 5946-fix-blocked-services-client-schedule
Browse files Browse the repository at this point in the history
Updates #5946.

Squashed commit of the following:

commit cd6ba61
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Jun 30 11:27:52 2023 +0300

    home: fix blocked services client schedule
  • Loading branch information
schzhn committed Jun 30, 2023
1 parent efed237 commit 1fd6cf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/home/clientshttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/AdguardTeam/AdGuardHome/internal/aghalg"
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
"github.com/AdguardTeam/AdGuardHome/internal/filtering"
"github.com/AdguardTeam/AdGuardHome/internal/schedule"
"github.com/AdguardTeam/AdGuardHome/internal/whois"
)

Expand Down Expand Up @@ -118,13 +119,18 @@ func (clients *clientsContainer) jsonToClient(cj clientJSON, prev *Client) (c *C
}
}

weekly := schedule.EmptyWeekly()
if prev != nil {
weekly = prev.BlockedServices.Schedule.Clone()
}

c = &Client{
safeSearchConf: safeSearchConf,

Name: cj.Name,

BlockedServices: &filtering.BlockedServices{
Schedule: prev.BlockedServices.Schedule.Clone(),
Schedule: weekly,
IDs: cj.BlockedServices,
},

Expand Down

0 comments on commit 1fd6cf1

Please sign in to comment.