Skip to content

Commit

Permalink
add (*) to title as indication of new event
Browse files Browse the repository at this point in the history
  • Loading branch information
krustowski committed Sep 12, 2024
1 parent c446e4b commit 82cc07c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#

APP_NAME=littr
APP_VERSION=0.40.5
APP_VERSION=0.40.6
GOLANG_VERSION=1.23
2 changes: 1 addition & 1 deletion api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "MIT",
"url": "https://github.com/krustowski/littr/blob/master/LICENSE"
},
"version": "0.40.5"
"version": "0.40.6"
},
"host": "www.littr.eu",
"basePath": "/api/v1",
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/router.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @title littr
// @version 0.40.5
// @version 0.40.6
// @description a simple nanoblogging platform as PWA built on go-app framework
// @termsOfService https://littr.eu/tos

Expand Down
7 changes: 7 additions & 0 deletions pkg/frontend/navbars.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ func (h *header) onMessage(ctx app.Context, e app.Event) {
snack.Set("innerHTML", "<i>info</i>"+text)
}

// change title to indicate a new event
title := app.Window().Get("document")
if !title.IsNull() && !strings.Contains(title.Get("title").String(), "(*)") {
prevTitle := title.Get("title").String()
title.Set("title", "(*) "+prevTitle)
}

/*ctx.Dispatch(func(ctx app.Context) {
// won't trigger the render for some reason...
//h.toastText = "new post added above"
Expand Down

0 comments on commit 82cc07c

Please sign in to comment.