about summary refs log tree commit diff stats
path: root/frontend
diff options
context:
space:
mode:
authorAlan Pearce2024-05-31 03:10:46 +0200
committerAlan Pearce2024-05-31 03:10:46 +0200
commitfc7542e01f1d6f9e1c11bacf0060c0165ba54986 (patch)
treeb1aabe8e45e2200d03ed7a2a86c4dccc1fb25cbd /frontend
parentb53769462bf830f860b7d741a3d0801afdbc9aa2 (diff)
downloadsearchix-fc7542e01f1d6f9e1c11bacf0060c0165ba54986.tar.lz
searchix-fc7542e01f1d6f9e1c11bacf0060c0165ba54986.tar.zst
searchix-fc7542e01f1d6f9e1c11bacf0060c0165ba54986.zip
build: re-enable asset reloading in dev
Diffstat (limited to 'frontend')
-rw-r--r--frontend/assets.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/frontend/assets.go b/frontend/assets.go
index a6a5e79..286d505 100644
--- a/frontend/assets.go
+++ b/frontend/assets.go
@@ -10,7 +10,7 @@ import (
 	"github.com/pkg/errors"
 )
 
-var Assets = AssetCollection{
+var Assets = &AssetCollection{
 	Scripts:     make(map[string]Asset),
 	Stylesheets: make(map[string]Asset),
 }
@@ -83,13 +83,22 @@ func hashStyles() error {
 	return nil
 }
 
-func init() {
-	err := hashScripts()
+func Rehash() (err error) {
+	err = hashScripts()
 	if err != nil {
-		panic(err)
+		return err
 	}
 	err = hashStyles()
 	if err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func init() {
+	err := Rehash()
+	if err != nil {
 		panic(err)
 	}
 }