mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
fix: handle non-ok repsoness
This commit is contained in:
1 parent
1ad75d8dc5
commit
63a608b3df
1 file changed
+3
@@ -15,6 +15,9 @@ export function useAdExempt() {
|
|||||||
`/api/patreon/membership/${patreon.token}`,
|
`/api/patreon/membership/${patreon.token}`,
|
||||||
{ cache: 'force-cache' },
|
{ cache: 'force-cache' },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!response.ok) return resolve(false);
|
||||||
|
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
const exempt = typeof json === 'boolean' && json;
|
const exempt = typeof json === 'boolean' && json;
|
||||||
cache[patreon.token] = exempt;
|
cache[patreon.token] = exempt;
|
||||||
|
|||||||
Reference in new issue
Block a user