mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 07:29:03 +01:00
Hide follow/unfollow button from public page if follow already requested
This commit is contained in:
parent
b891a81008
commit
9d42bff285
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.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'
|
||||
|
|
Loading…
Reference in a new issue