Skip to content
Snippets Groups Projects
Commit 9d42bff2 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Hide follow/unfollow button from public page if follow already requested

parent b891a810
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,10 @@ class Account < ApplicationRecord
blocking.include?(other_account)
end
def requested?(other_account)
follow_requests.where(target_account: other_account).exists?
end
def local?
domain.nil?
end
......
.card{ style: "background-image: url(#{@account.header.url( :original)})" }
- if user_signed_in? && current_account.id != @account.id
- if user_signed_in? && current_account.id != @account.id && !current_account.requested?(@account)
.controls
- if current_account.following?(@account)
= link_to t('accounts.unfollow'), unfollow_account_path(@account), data: { method: :post }, class: 'button'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment