mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
FIX: emoji rebuild when changing emoji set for the 1st time
This commit is contained in:
parent
114cc1c851
commit
2b3e311e8e
@ -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 New Issue
Block a user