8000 Remove unnecessary explicit render? check for phlex components by Floppy · Pull Request #4140 · manyfold3d/manyfold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove unnecessary explicit render? check for phlex components #4140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions app/components/follow_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def initialize(follower:, target:, name: nil)
end

def view_template
return unless render?
button_to(
@path,
method: @method,
Expand All @@ -23,6 +22,13 @@ def view_template
end
end

def render?
SiteSettings.social_enabled? && (
Pundit::PolicyFinder.new(Federails::Following).policy.new(current_user, nil).create? ||
remote_follow_allowed?
)
end

private

def before_template
Expand Down Expand Up @@ -51,13 +57,6 @@ def before_template
super
end

def render?
SiteSettings.social_enabled? && (
Pundit::PolicyFinder.new(Federails::Following).policy.new(current_user, nil).create? ||
remote_follow_allowed?
)
end

def remote_follow_allowed?
SiteSettings.federation_enabled? && @signed_out
end
Expand Down
3 changes: 0 additions & 3 deletions app/components/resolve_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def before_template
end

def view_template
return unless render?
text = t @options[:i18n_key]
if @problem.in_progress
link_to("#", class: "btn btn-#{@options[:button_type]} disabled") do
Expand All @@ -73,8 +72,6 @@ def view_template
end
end

private

def render?
ProblemPolicy.new(@user, @problem).resolve?
end
Expand Down
Loading
0