fix: handle non-ok repsoness

This commit is contained in:
TrèsAbhi committed 2024-06-29 13:40:38 -05:00
1 parent 1ad75d8dc5
commit 63a608b3df
1 file changed
+3
+3
View File
@@ -15,6 +15,9 @@ export function useAdExempt() {
`/api/patreon/membership/${patreon.token}`,
{ cache: 'force-cache' },
);
if (!response.ok) return resolve(false);
const json = await response.json();
const exempt = typeof json === 'boolean' && json;
cache[patreon.token] = exempt;