File tree 1 file changed +13
-7
lines changed
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,22 @@ export class ContentClaimsLocator {
72
72
const claims = await Claims . read ( cid , { serviceURL : this . #serviceURL } )
73
73
for ( const claim of claims ) {
74
74
if ( claim . type === 'assert/location' && claim . range ?. length != null ) {
75
- this . #cache. set ( digest , {
76
- digest ,
77
- site : [ {
75
+ const location = this . #cache. get ( digest )
76
+ if ( location ) {
77
+ location . site . push ( {
78
78
location : claim . location . map ( l => new URL ( l ) ) ,
79
79
range : { offset : claim . range . offset , length : claim . range . length }
80
- } ]
81
- } )
82
- continue
80
+ } )
81
+ } else {
82
+ this . #cache. set ( digest , {
83
+ digest,
84
+ site : [ {
85
+ location : claim . location . map ( l => new URL ( l ) ) ,
86
+ range : { offset : claim . range . offset , length : claim . range . length }
87
+ } ]
88
+ } )
89
+ }
83
90
}
84
- break
85
91
}
86
92
this . #claimFetched. set ( digest , true )
87
93
}
You can’t perform that action at this time.
0 commit comments