mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Prevent creation of empty entry in _connectorCache for raw templates. (#4296)
This commit is contained in:
parent
e4074f75b1
commit
deda9a6908
1 changed files with 2 additions and 2 deletions
|
@ -86,13 +86,12 @@ function buildConnectorCache() {
|
|||
});
|
||||
|
||||
findOutlets(Ember.TEMPLATES, function(outletName, resource, uniqueName) {
|
||||
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
||||
|
||||
const mixin = {templateName: resource.replace('javascripts/', '')};
|
||||
let viewClass = uniqueViews[uniqueName];
|
||||
|
||||
if (viewClass) {
|
||||
// We are going to add it back with the proper template
|
||||
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
||||
_connectorCache[outletName].removeObject(viewClass);
|
||||
} else {
|
||||
if (!/\.raw$/.test(uniqueName)) {
|
||||
|
@ -101,6 +100,7 @@ function buildConnectorCache() {
|
|||
}
|
||||
|
||||
if (viewClass) {
|
||||
_connectorCache[outletName] = _connectorCache[outletName] || [];
|
||||
_connectorCache[outletName].pushObject(viewClass.extend(mixin));
|
||||
} else {
|
||||
// we have a raw template
|
||||
|
|
Loading…
Reference in a new issue