This repository was archived by the owner on Jul 22, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ module.exports = function(fractal){
20
20
if ( ! entity ) {
21
21
throw new Error ( `Could not get context for component '${ handle } ' - component not found.` ) ;
22
22
}
23
- const defaultContext = entity . isComponent ? entity . variants ( ) . default ( ) . context : entity . context ;
24
- return source . resolve ( _ . defaultsDeep ( context || { } , defaultContext ) ) ;
23
+ const defaultContext = entity . isComponent ? entity . variants ( ) . default ( ) . getContext ( ) : entity . getContext ( ) ;
24
+ return _ . defaultsDeep ( context || { } , defaultContext ) ;
25
25
} ;
26
26
27
27
} ;
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ module.exports = function(fractal){
10
10
if ( ! entity ) {
11
11
throw new Error ( `Could not get context for component '${ handle } ' - component not found.` ) ;
12
12
}
13
- const context = entity . isComponent ? entity . variants ( ) . default ( ) . context : entity . context ;
14
- return source . resolve ( context ) . then ( ctx => new Handlebars . SafeString ( JSON . stringify ( ctx , null , 4 ) ) ) ;
13
+ const context = entity . isComponent ? entity . variants ( ) . default ( ) . getContext ( ) : entity . getContext ( ) ;
14
+ return new Handlebars . SafeString ( JSON . stringify ( context , null , 4 ) ) ;
15
15
} ;
16
16
17
17
} ;
Original file line number Diff line number Diff line change @@ -24,20 +24,21 @@ module.exports = function(fractal){
24
24
if ( ! entity ) {
25
25
throw new Error ( `Could not render component '${ handle } ' - component not found.` ) ;
26
26
}
27
- const defaultContext = entity . isComponent ? entity . variants ( ) . default ( ) . context : entity . context ;
27
+ const defaultContext = entity . isComponent ? entity . variants ( ) . default ( ) . getContext ( ) : entity . getContext ( ) ;
28
28
if ( ! context ) {
29
29
context = defaultContext ;
30
30
} else if ( merge ) {
31
31
context = utils . defaultsDeep ( context , defaultContext ) ;
32
32
}
33
-
33
+
34
34
return source . resolve ( context ) . then ( context => {
35
35
// fix env for rendered components
36
36
let env = JSON . parse ( JSON . stringify ( root . _env ) ) ;
37
37
_ . set ( context , '_env' , env ) ;
38
38
39
- return entity . render ( context ) . then ( html => new Handlebars . SafeString ( html ) ) ;
39
+ return entity . render ( context ) . then ( html => new Handlebars . SafeString ( html ) ) . catch ( err => { } ) ;
40
40
} ) ;
41
+
41
42
} ;
42
43
43
44
} ;
You can’t perform that action at this time.
0 commit comments