File tree 2 files changed +13
-1
lines changed
lib/philomena_web/controllers
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ config :philomena, csp_relaxed: true
78
78
# Enable Vite HMR
79
79
config :philomena , vite_reload: true
80
80
81
+ # Display the uploads immediately once thumbnails are generated, we don't need
82
+ # to wait more than that in dev mode.
83
+ config :philomena , new_uploads_hidden_duration: "0 minutes"
84
+
81
85
# Set a higher stacktrace during development. Avoid configuring such
82
86
# in production as building large stacktraces may be expensive.
83
87
config :phoenix , :stacktrace_depth , 20
Original file line number Diff line number Diff line change @@ -17,13 +17,21 @@ defmodule PhilomenaWeb.ActivityController do
17
17
alias Philomena.Repo
18
18
import Ecto.Query
19
19
20
+ # Delay displaying new uploads on the homepage to give the users some time to
21
+ # add last-minute tags on the image after the fact of upload.
22
+ @ new_uploads_hidden_duration Application . compile_env (
23
+ :philomena ,
24
+ :new_uploads_hidden_duration ,
25
+ "3 minutes"
26
+ )
27
+
20
28
def index ( conn , _params ) do
21
29
user = conn . assigns . current_user
22
30
23
31
{ :ok , { images , _tags } } =
24
32
ImageLoader . search_string (
25
33
conn ,
26
- "created_at.lte:3 minutes ago, -thumbnails_generated:false" ,
34
+ "created_at.lte:#{ @ new_uploads_hidden_duration } ago, -thumbnails_generated:false" ,
27
35
pagination: % { conn . assigns . image_pagination | page_number: 1 }
28
36
)
29
37
You can’t perform that action at this time.
0 commit comments