From 28af94cba3359e696bd333069986cb351c049123 Mon Sep 17 00:00:00 2001 From: Seednode Date: Thu, 10 Nov 2022 09:38:40 -0600 Subject: [PATCH] Refresh now happens X seconds after page finishes completely loading, not X seconds after the initial request is sent --- cmd/version.go | 2 +- cmd/web.go | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index 06b3109..5aabbec 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.25.1" +var Version = "0.25.2" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index c0a948b..875c3f1 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -195,22 +195,23 @@ func serveHtml(w http.ResponseWriter, r *http.Request, filePath string, dimensio dimensions.Width, dimensions.Height)) htmlBody.WriteString(``) - htmlBody.WriteString(fmt.Sprintf(`Roulette selected: %v`, - queryParams, - generateFilePath(filePath), - dimensions.Width, - dimensions.Height, - fileName)) if refreshInterval != "0" { r, err := strconv.Atoi(refreshInterval) if err != nil { return err } refreshTimer := strconv.Itoa(r * 1000) - htmlBody.WriteString(fmt.Sprintf(``, + + htmlBody.WriteString(fmt.Sprintf("", queryParams, refreshTimer)) } + htmlBody.WriteString(fmt.Sprintf(`Roulette selected: %v`, + queryParams, + generateFilePath(filePath), + dimensions.Width, + dimensions.Height, + fileName)) htmlBody.WriteString(``) _, err := io.WriteString(w, gohtml.Format(htmlBody.String()))