feat: patreon plug

This commit is contained in:
TrèsAbhi committed 2024-06-15 13:16:12 -05:00
1 parent 0a0376312b
commit 14e45d97d2
11 files changed
+126 -61

No files matched your search

+8 -3
View File
@@ -1,3 +1,4 @@
import { use } from 'react';
import { useApp } from '../stores/app';
export function useAdExempt() {
@@ -5,7 +6,11 @@ export function useAdExempt() {
if (!patreon) return false;
fetch(`/api/patreon/membership/${patreon.token}`)
.then((response) => response.json())
.then(console.log);
const json = use(
fetch(`/api/patreon/membership/${patreon.token}`, {
cache: 'force-cache',
}).then((response) => response.json()),
);
return typeof json === 'boolean' && json;
}