Skip to content

Commit 8f38a26

Browse files
committed
add state query param
1 parent 2bfd0ab commit 8f38a26

File tree

2 files changed

+2
-84
lines changed

2 files changed

+2
-84
lines changed

package-lock.json

-81
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { decode } from 'jpeg-js'
88
import pica from 'pica'
99

1010
export async function getPosts(username: string): Promise<PostType[]> {
11-
const url = `${API_URL}/articles?username=${username}&per_page=1000`
11+
const url = `${API_URL}/articles?username=${username}&per_page=1000&state=fresh`
1212
const response = await fetch(url, fetchOpts)
1313
return await response.json()
1414
}
@@ -99,8 +99,7 @@ export async function generateThumbhash(imageUrl: string) {
9999
const thumbSize = 100
100100

101101
const res = await fetch(imageUrl)
102-
const blob = await res.blob()
103-
const arrayBuf = await blob.arrayBuffer()
102+
const arrayBuf = await res.arrayBuffer()
104103
const decoded = decode(arrayBuf, { useTArray: true })
105104
const { width, height, data } = decoded
106105
const imageWidth = Math.floor((width / height) * thumbSize)

0 commit comments

Comments
 (0)