mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: Ember CLI was losing some preloaded data (#13406)
The `bootstrap.json` contains most preloaded information but some routes provide extra information, such as invites. This fixes the issue by having the preload request pass on the preloaded data from the source page, which is then merged with the bootstrap's preloaded data for the final HTML payload.
This commit is contained in:
parent
20dbcbf022
commit
651b8a23b8
2 changed files with 21 additions and 11 deletions
|
@ -322,7 +322,9 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def send_ember_cli_bootstrap
|
||||
head 200, content_type: "text/html", "X-Discourse-Bootstrap-Required": true
|
||||
response.headers['X-Discourse-Bootstrap-Required'] = true
|
||||
response.headers['Content-Type'] = "application/json"
|
||||
render json: { preloaded: @preloaded }
|
||||
end
|
||||
|
||||
# If a controller requires a plugin, it will raise an exception if that plugin is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue