File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export interface CardError {
35
35
status : number ;
36
36
title : string ;
37
37
message : string ;
38
+ realm : string ;
38
39
meta : {
39
40
lastKnownGoodHtml : string | null ;
40
41
scopedCssUrls : string [ ] ;
@@ -283,6 +284,7 @@ export class CardResource extends Resource<Args> {
283
284
status : 404 ,
284
285
title : 'Card Not Found' ,
285
286
message : `The card ${ url . href } does not exist` ,
287
+ realm : error . responseHeaders . get ( 'X-Boxel-Realm-Url' ) ,
286
288
meta : {
287
289
lastKnownGoodHtml : null ,
288
290
scopedCssUrls : [ ] ,
@@ -302,6 +304,7 @@ export class CardResource extends Resource<Args> {
302
304
message : `Received HTTP ${ error . status } from server ${
303
305
error . responseText ?? ''
304
306
} `. trim ( ) ,
307
+ realm : error . responseHeaders . get ( 'X-Boxel-Realm-Url' ) ,
305
308
meta : {
306
309
lastKnownGoodHtml : null ,
307
310
scopedCssUrls : [ ] ,
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Resource } from 'ember-resources';
5
5
6
6
import type { Stack } from '../components/operator-mode/interact-submode' ;
7
7
import type CardService from '../services/card-service' ;
8
+ import type RealmService from '../services/realm' ;
8
9
9
10
interface Args {
10
11
positional : [ stacks : Stack [ ] ] ;
@@ -13,6 +14,7 @@ interface Args {
13
14
export class StackBackgroundsResource extends Resource < Args > {
14
15
@tracked value : ( string | undefined | null ) [ ] = [ ] ;
15
16
@service declare cardService : CardService ;
17
+ @service declare realm : RealmService ;
16
18
17
19
get backgroundImageURLs ( ) {
18
20
return this . value ?. map ( ( u ) => ( u ? u : undefined ) ) ?? [ ] ;
@@ -47,7 +49,9 @@ export class StackBackgroundsResource extends Resource<Args> {
47
49
let bottomMostStackItem = stack [ 0 ] ;
48
50
await bottomMostStackItem . ready ;
49
51
if ( bottomMostStackItem . cardError ) {
50
- return undefined ;
52
+ await this . realm . ensureRealmMeta ( bottomMostStackItem . cardError . realm ) ;
53
+ return this . realm . info ( bottomMostStackItem . cardError . realm )
54
+ ?. backgroundURL ;
51
55
}
52
56
return ( await this . cardService . getRealmInfo ( bottomMostStackItem . card ) )
53
57
?. backgroundURL ;
Original file line number Diff line number Diff line change @@ -1405,6 +1405,9 @@ export class Realm {
1405
1405
status : maybeError . error . errorDetail . status ,
1406
1406
title : maybeError . error . errorDetail . title ,
1407
1407
message : maybeError . error . errorDetail . detail ,
1408
+ // note that this is actually available as part of the response
1409
+ // header too--it's just easier for clients when it is here
1410
+ realm : this . url ,
1408
1411
meta : {
1409
1412
lastKnownGoodHtml : maybeError . error . lastKnownGoodHtml ,
1410
1413
scopedCssUrls : maybeError . error . scopedCssUrls ,
You can’t perform that action at this time.
0 commit comments