Skip to content

Commit

Permalink
fix: support blob response types
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Jul 22, 2024
1 parent c820d3d commit 218631c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/fragments/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/fragments",
"description": "Simple geometric system built on top of Three.js to display 3D BIM data efficiently.",
"version": "2.1.3",
"version": "2.1.4",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
9 changes: 8 additions & 1 deletion packages/fragments/src/fragments-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@ export class FragmentsGroup extends THREE.Group {

private async getPropertiesData(url: string) {
const fetched = await FragmentsGroup.fetch(url);
return fetched.json();
if (fetched.json) {
return fetched.json();
}
if (fetched.text) {
const text = await fetched.text();
return JSON.parse(text);
}
throw new Error("Invalid response type when getting properties data.");
}

private constructFileName(fileID: number) {
Expand Down

0 comments on commit 218631c

Please sign in to comment.