diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/audio/index.js | 2 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/features/video/index.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/features/audio/index.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/features/video/index.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/locales/vi.json | 4 | ||||
-rw-r--r-- | app/services/after_unallow_domain_service.rb | 9 | ||||
-rw-r--r-- | app/services/unallow_domain_service.rb | 5 | ||||
-rw-r--r-- | app/workers/after_unallow_domain_worker.rb | 9 |
8 files changed, 30 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 9cb2307fd..4e85e3c58 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -283,6 +283,8 @@ class Audio extends React.PureComponent { _renderCanvas () { requestAnimationFrame(() => { + if (!this.audio) return; + this.handleTimeUpdate(); this._clear(); this._draw(); diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 976cdefc0..cc60a0d2e 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -195,6 +195,8 @@ class Video extends React.PureComponent { _updateTime () { requestAnimationFrame(() => { + if (!this.video) return; + this.handleTimeUpdate(); if (!this.state.paused) { 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 |