Skip to content

Commit

Permalink
fix sui page locale and theme data caching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Jul 15, 2024
1 parent d5584ca commit 08f3fbc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sui/api/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ func (r *Request) Render() (string, int, error) {
if !r.Request.DisableCache() && c.DataCacheTime > 0 && c.CacheStore != "" {
data, dataHitCache = c.GetData(dataCacheKey)
if dataHitCache {
if locale, ok := data["$locale"].(string); ok {
r.Request.Locale = locale
}

if theme, ok := data["$theme"].(string); ok {
r.Request.Theme = theme
}
log.Trace("[SUI] The page %s data is cached %v file=%s key=%s", r.Request.URL.Path, c.DataCacheTime, r.File, dataCacheKey)
}
}
Expand Down

0 comments on commit 08f3fbc

Please sign in to comment.