mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-29 20:19:04 +01:00
feat: apply disable animations before the first paint
This commit is contained in:
@@ -139,7 +139,10 @@ func registerGlobalMiddleware(r *gin.Engine) {
|
||||
|
||||
func registerRoutes(r *gin.Engine, db *gorm.DB, svc *services, auth *authz.Middleware, rateLimitServices map[string]*ratelimit.RateLimitService) error {
|
||||
|
||||
err := frontend.RegisterFrontend(r)
|
||||
err := frontend.RegisterFrontend(r, func(ctx context.Context) bool {
|
||||
cfg, err := svc.appConfigService.GetConfig(ctx)
|
||||
return err == nil && cfg.DisableAnimations.IsTrue()
|
||||
})
|
||||
if errors.Is(err, frontend.ErrFrontendNotIncluded) {
|
||||
slog.Warn("Frontend is not included in the build. Skipping frontend registration.")
|
||||
} else if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user