Skip to content

Commit

Permalink
Creators and Dragverse Team Verification
Browse files Browse the repository at this point in the history
  • Loading branch information
justsoantsy committed Mar 18, 2024
1 parent 7fda4f7 commit 1e39f21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
14 changes: 12 additions & 2 deletions apps/web/src/components/Common/Providers/TogglesProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import useVerifiedStore from '@lib/store/idb/verified'
import { useQuery } from '@tanstack/react-query'
import axios from 'axios'

import { myVerifiedProfiles } from './myVerifiedProfiles'

const TogglesProvider = () => {
const activeProfile = useProfileStore((state) => state.activeProfile)
const setVerifiedProfiles = useVerifiedStore(
Expand All @@ -25,8 +27,15 @@ const TogglesProvider = () => {
)

const fetchVerifiedProfiles = async () => {
const { data } = await axios.get(WORKER_VERIFIED_URL)
setVerifiedProfiles(data?.ids ?? [])
try {
const { data } = await axios.get(WORKER_VERIFIED_URL)
const backendVerifiedProfiles = data?.ids ?? [];
const combinedVerifiedProfiles = [...new Set([...backendVerifiedProfiles, ...myVerifiedProfiles])];
setVerifiedProfiles(combinedVerifiedProfiles);
} catch (error) {
console.error('Error fetching verified profiles:', error);
// Handle error appropriately
}
}

useQuery({
Expand Down Expand Up @@ -68,3 +77,4 @@ const TogglesProvider = () => {
}

export default TogglesProvider

11 changes: 11 additions & 0 deletions apps/web/src/components/Common/Providers/myVerifiedProfiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// apps/web/src/components/Common/Providers/myVerifiedProfiles.js
export const myVerifiedProfiles = [
'0x01b89c',
'0x25bb',
'0x01b98c',
'0x01ec9c',
'0x01ed5f',
'0x01ecc3',
'0x4bed'
];

0 comments on commit 1e39f21

Please sign in to comment.