about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-07-16 14:43:50 +0200
committerThibaut Girka <thib@sitedethib.com>2020-07-16 14:43:50 +0200
commit1c6c40d17c233171c6252503df10da72fd039cf6 (patch)
tree2827f6bf22d6356f8c2103cecfa260608050f67f /app
parent37c092e9fdedd36c167e4b84610e7346c446e1d3 (diff)
parentea13e80030117c95f5e52d730d00093e21b11eea (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/features/audio/index.js2
-rw-r--r--app/javascript/mastodon/features/video/index.js2
-rw-r--r--app/javascript/mastodon/locales/vi.json4
-rw-r--r--app/services/after_unallow_domain_service.rb9
-rw-r--r--app/services/unallow_domain_service.rb5
-rw-r--r--app/workers/after_unallow_domain_worker.rb9
6 files changed, 26 insertions, 5 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js
index 2f85ebb7e..1ab1c3117 100644
--- a/app/javascript/mastodon/features/audio/index.js
+++ b/app/javascript/mastodon/features/audio/index.js
@@ -298,6 +298,8 @@ class Audio extends React.PureComponent {
 
   _renderCanvas () {
     requestAnimationFrame(() => {
+      if (!this.audio) return;
+
       this.handleTimeUpdate();
       this._clear();
       this._draw();
diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js
index fb12567f0..99dcdca22 100644
--- a/app/javascript/mastodon/features/video/index.js
+++ b/app/javascript/mastodon/features/video/index.js
@@ -182,6 +182,8 @@ class Video extends React.PureComponent {
 
   _updateTime () {
     requestAnimationFrame(() => {
+      if (!this.video) return;
+
       this.handleTimeUpdate();
 
       if (!this.state.paused) {
diff --git a/app/javascript/mastodon/locales/vi.json b/app/javascript/mastodon/locales/vi.json
index 7d4c1c45e..17c4302c2 100644
--- a/app/javascript/mastodon/locales/vi.json
+++ b/app/javascript/mastodon/locales/vi.json
@@ -23,7 +23,7 @@
   "account.last_status": "Hoạt động gần đây",
   "account.link_verified_on": "Liên kết này đã được xác thực vào {date}",
   "account.locked_info": "Người dùng này thiết lập trạng thái ẩn. Họ sẽ tự mình xét duyệt các yêu cầu theo dõi.",
-  "account.media": "Đa phương tiện",
+  "account.media": "Bộ sưu tập",
   "account.mention": "Nhắc đến @{name}",
   "account.moved_to": "{name} đã dời sang:",
   "account.mute": "Ẩn @{name}",
@@ -43,7 +43,7 @@
   "account.unfollow": "Ngưng theo dõi",
   "account.unmute": "Bỏ ẩn @{name}",
   "account.unmute_notifications": "Hiển lại thông báo từ @{name}",
-  "account_note.placeholder": "Không nói gì thêm",
+  "account_note.placeholder": "Nhấn để thêm ghi chú",
   "alert.rate_limited.message": "Vui lòng thử lại sau {retry_time, time, medium}.",
   "alert.rate_limited.title": "Vượt giới hạn",
   "alert.unexpected.message": "Đã xảy ra lỗi không mong muốn.",
diff --git a/app/services/after_unallow_domain_service.rb b/app/services/after_unallow_domain_service.rb
new file mode 100644
index 000000000..ccd0b8ae9
--- /dev/null
+++ b/app/services/after_unallow_domain_service.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AfterUnallowDomainService < BaseService
+  def call(domain)
+    Account.where(domain: domain).find_each do |account|
+      SuspendAccountService.new.call(account, reserve_username: false)
+    end
+  end
+end
diff --git a/app/services/unallow_domain_service.rb b/app/services/unallow_domain_service.rb
index 870c79951..fc5260761 100644
--- a/app/services/unallow_domain_service.rb
+++ b/app/services/unallow_domain_service.rb
@@ -12,8 +12,7 @@ class UnallowDomainService < BaseService
   private
 
   def suspend_accounts!(domain)
-    Account.where(domain: domain).find_each do |account|
-      SuspendAccountService.new.call(account, reserve_username: false)
-    end
+    Account.where(domain: domain).in_batches.update_all(suspended_at: Time.now.utc)
+    AfterUnallowDomainWorker.perform_async(domain)
   end
 end
diff --git a/app/workers/after_unallow_domain_worker.rb b/app/workers/after_unallow_domain_worker.rb
new file mode 100644
index 000000000..46049cbb2
--- /dev/null
+++ b/app/workers/after_unallow_domain_worker.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AfterUnallowDomainWorker
+  include Sidekiq::Worker
+
+  def perform(domain)
+    AfterUnallowDomainService.new.call(domain)
+  end
+end