mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: emoji rebuild when changing emoji set for the 1st time
This commit is contained in:
parent
114cc1c851
commit
2b3e311e8e
1 changed files with 5 additions and 2 deletions
|
@ -2,12 +2,15 @@ require 'enum_site_setting'
|
|||
|
||||
class EmojiSetSiteSetting < EnumSiteSetting
|
||||
|
||||
NAME = :emoji_set
|
||||
|
||||
# fix the URLs when changing the site setting
|
||||
DiscourseEvent.on(:site_setting_saved) do |site_setting|
|
||||
if site_setting.name.to_s == "emoji_set" && site_setting.value_changed?
|
||||
if site_setting.name == NAME && site_setting.value_changed?
|
||||
Emoji.clear_cache
|
||||
|
||||
before = "/images/emoji/#{site_setting.value_was}/"
|
||||
previous_value = site_setting.value_was || SiteSetting.defaults[NAME]
|
||||
before = "/images/emoji/#{previous_value}/"
|
||||
after = "/images/emoji/#{site_setting.value}/"
|
||||
|
||||
Scheduler::Defer.later("Fix Emoji Links") do
|
||||
|
|
Loading…
Reference in a new issue