fix: use default topic if none is given
This commit is contained in:
parent
ac2940ccfe
commit
64e91cb2d4
1 changed files with 5 additions and 2 deletions
7
main.go
7
main.go
|
@ -77,8 +77,11 @@ func main() {
|
|||
}
|
||||
|
||||
slog.Debug("Registering bridge", "route", route, "handler", handler.Type)
|
||||
// TODO: use default topic if topic == ""
|
||||
bridge := bridge.NewBridge(cfg.Ntfy.Server, handler.Topic, h)
|
||||
topic := handler.Topic
|
||||
if topic == "" {
|
||||
topic = cfg.Ntfy.DefaultTopic
|
||||
}
|
||||
bridge := bridge.NewBridge(cfg.Ntfy.Server, topic, h)
|
||||
if !auth.IsEmpty() {
|
||||
bridge.WithAuth(auth)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue