Skip to content

Commit db39a14

Browse files
castastropheclaude
andcommitted
fix(data): handle string response in subtags fetch
Add type check before decoding response to handle cases where the response is already a string. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fa8d991 commit db39a14

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎_data/subtags.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default async function () {
1010
type: "text",
1111
})
1212
.then(response => {
13-
const decoder = new TextDecoder('utf-8');
14-
return decoder.decode(response);
13+
if (typeof response !== 'string') {
14+
const decoder = new TextDecoder('utf-8');
15+
return decoder.decode(response);
16+
} else return response;
1517
})
1618
.catch(error => {
1719
console.error('There has been a problem with your fetch operation:', error);

0 commit comments

Comments
 (0)