Skip to content

Commit b82dc67

Browse files
committed
fix(notifications): using correct network prefix
1 parent 975e84b commit b82dc67

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

backend/pkg/api/data_access/notifications.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,10 +1541,22 @@ func (d *DataAccessService) GetNotificationSettingsDashboards(ctx context.Contex
15411541
Threshold float64 `db:"event_threshold"`
15421542
}{}
15431543

1544-
networkName := "mainnet"
1545-
if utils.Config.Chain.ClConfig.DepositChainID == 17000 {
1546-
networkName = "holesky"
1544+
networks, err := d.GetAllNetworks()
1545+
if err != nil {
1546+
return nil, nil, err
1547+
}
1548+
1549+
var networkName string
1550+
for _, network := range networks {
1551+
if network.ChainId == utils.Config.Chain.ClConfig.DepositChainID {
1552+
networkName = network.NotificationsName
1553+
break
1554+
}
15471555
}
1556+
if networkName == "" {
1557+
return nil, nil, fmt.Errorf("network with chain id %d to update general notification settings not found", utils.Config.Chain.ClConfig.DepositChainID)
1558+
}
1559+
15481560
wg.Go(func() error {
15491561
err := d.userReader.SelectContext(ctx, &events, `
15501562
SELECT

0 commit comments

Comments
 (0)