From c221d7dde0b81085693c82fc388f87407802dbfc Mon Sep 17 00:00:00 2001 From: b5 Date: Wed, 11 Apr 2018 13:11:58 -0400 Subject: [PATCH] fix(webapp): replaced hardcoded entryupintupdateaddress --- api/webapp.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/api/webapp.go b/api/webapp.go index 5612168a5..62a6d181e 100644 --- a/api/webapp.go +++ b/api/webapp.go @@ -38,17 +38,26 @@ func (s *Server) WebappJSHandler() http.Handler { } func (s *Server) resolveWebappPath(path *string) { + if s.cfg.Webapp.EntrypointUpdateAddress == "" { + log.Debug("no entrypoint update address specified for update checking") + return + } + node, err := s.qriNode.IPFSNode() if err != nil { - log.Infof("no IPFS node present to resolve webapp address: %s", err.Error()) + log.Debugf("no IPFS node present to resolve webapp address: %s", err.Error()) return } - p, err := node.Namesys.Resolve(context.Background(), "/ipns/webapp.qri.io") + p, err := node.Namesys.Resolve(context.Background(), s.cfg.Webapp.EntrypointUpdateAddress) if err != nil { log.Infof("error resolving IPNS Name: %s", err.Error()) return } + if *path != p.String() { + log.Infof("updating webapp to version: %s", p.String()) + } + *path = p.String() }