end
def unfavourite
- @status = UnfavouriteService.new.call(current_user.account, Status.find(params[:id])).status.reload
+ @status = Status.find(params[:id])
+ @favourited_map = { @status.id => false }
+
+ UnfavouriteWorker.perform_async(current_user.account_id, @status.id)
+
render action: :show
end
node(:cache_age) { 86_400 }
node(:html) { |entry| "<iframe src=\"#{embed_account_stream_entry_url(entry.account, entry)}\" style=\"width: 100%; overflow: hidden\" frameborder=\"0\" width=\"#{@width}\" height=\"#{@height}\" scrolling=\"no\"></iframe>" }
node(:width) { @width }
-node(:height) { nil }
+node(:height) { @height }
--- /dev/null
+# frozen_string_literal: true
+
+class UnfavouriteWorker
+ include Sidekiq::Worker
+
+ def perform(account_id, status_id)
+ UnfavouriteService.new.call(Account.find(account_id), Status.find(status_id))
+ end
+end