commit 5e6367080023b4f115eb1a44dd3a38b07a4081f0
parent 59e26cc20e6594b0c59f4074fd2f44d6ef4402af
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Wed, 25 Jan 2023 13:19:28 -0800
cleanup
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -771,10 +771,7 @@ func waitPageWrapper(c echo.Context, clb echo.HandlerFunc, cookieName string) er
if cc, payload, err := hutils.EncCookie[WaitPageCookiePayload](c, cookieName); err != nil {
// No cookie found, we create one and display the waiting page.
- waitTime := utils.Random(5, 15)
- if config.Development.IsTrue() {
- waitTime = 2
- }
+ waitTime := getWaitPageDuration()
waitToken = utils.GenerateToken10()
payload := WaitPageCookiePayload{
Token: waitToken,
@@ -2279,6 +2276,14 @@ func getTutorialStepDuration() int64 {
return secs
}
+func getWaitPageDuration() int64 {
+ secs := utils.Random(5, 15)
+ if config.Development.IsTrue() {
+ secs = 2
+ }
+ return secs
+}
+
func ChatHelpHandler(c echo.Context) error {
var data chatHelpData
return c.Render(http.StatusOK, "chat-help", data)