Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
social
gab-social
Commits
d084b8d5
Commit
d084b8d5
authored
Aug 18, 2019
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated route matches in home_controller
Added in set_data_for_meta too
parent
5750786d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
app/controllers/home_controller.rb
app/controllers/home_controller.rb
+7
-3
No files found.
app/controllers/home_controller.rb
View file @
d084b8d5
...
...
@@ -13,6 +13,8 @@ class HomeController < ApplicationController
private
def
set_data_for_meta
return
if
find_route_matches
if
params
[
:username
].
present?
@account
=
Account
.
find_local
(
params
[
:username
])
elsif
params
[
:account_username
].
present?
...
...
@@ -35,13 +37,15 @@ class HomeController < ApplicationController
return
if
user_signed_in?
# if no current user, dont allow to navigate to these paths
matches
=
request
.
path
.
match
(
/\A\/(home|groups|tags|lists|notifications|explore|follow_requests|blocks|domain_blocks|mutes)/
)
if
matches
if
find_route_matches
redirect_to
(
homepage_path
)
end
end
def
find_route_matches
request
.
path
.
match
(
/\A\/(home|groups|lists|notifications|explore|follow_requests|blocks|domain_blocks|mutes)/
)
end
def
set_initial_state_json
serializable_resource
=
ActiveModelSerializers
::
SerializableResource
.
new
(
InitialStatePresenter
.
new
(
initial_state_params
),
serializer:
InitialStateSerializer
)
@initial_state_json
=
serializable_resource
.
to_json
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment