diff --git a/.env.sample b/.env.sample index af48feaa9b..17511d8bcf 100644 --- a/.env.sample +++ b/.env.sample @@ -26,4 +26,4 @@ FRONTEND_URL=http://localhost:3000 # packages/backend IMGIX_TOKEN= -# GITHUB_API_TOKEN= # IMPORTANT! create one at https://github.com/settings/tokens +# GITHUB_API_TOKEN= # In order to seed a local database with player data, you will need to create one at https://github.com/settings/tokens diff --git a/packages/backend/src/handlers/actions/routes.ts b/packages/backend/src/handlers/actions/routes.ts index ba9302190a..5fbe62826e 100644 --- a/packages/backend/src/handlers/actions/routes.ts +++ b/packages/backend/src/handlers/actions/routes.ts @@ -1,6 +1,7 @@ import express from 'express'; import { asyncHandlerWrapper } from '../../lib/apiHelpers.js'; +import { routes as composeDBRoutes } from './composeDB/routes.js'; import { guildRoutes } from './guild/routes.js'; import { syncAllGuildDiscordMembers } from './guild/sync.js'; import syncBalances from './player/syncBalances.js'; @@ -23,3 +24,5 @@ actionRoutes.post( actionRoutes.use('/quests', questsRoutes); actionRoutes.use('/guild', guildRoutes); + +actionRoutes.use('/composeDB', composeDBRoutes); diff --git a/packages/backend/src/handlers/actions/sourcecred/sync.ts b/packages/backend/src/handlers/actions/sourcecred/sync.ts index be2023155a..b041914d7a 100644 --- a/packages/backend/src/handlers/actions/sourcecred/sync.ts +++ b/packages/backend/src/handlers/actions/sourcecred/sync.ts @@ -53,7 +53,11 @@ export const syncSourceCredAccounts = async ( const { error: loadError } = await ledgerManager.reloadLedger(); if (loadError) { - throw new Error(`Unable to load ledger: ${loadError}`); + throw new Error( + `Unable to load ledger: ${loadError}.\n` + + 'Make sure you have a valid GITHUB_API_TOKEN set in your .env ' + + 'that has access to https://github.com/MetaFam/XP. See guides/BACKEND.md for more info.', + ); } const force = req.query.force != null; diff --git a/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx b/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx index 677c2fcd4e..639e103d41 100644 --- a/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx +++ b/packages/web/components/Player/Profile/ComposeDBPromptModal.tsx @@ -161,19 +161,6 @@ export const ComposeDBPromptModal: React.FC = ({ siloing it off into tens of other application databases like in the web2 world. - - What data does this include? - - - MyMeta's ComposeDB model includes: - - {Object.values(profileMapping).map((field) => ( - {field} - ))} - - Note that skills and DAO memberships are currently not{' '} - being stored in ComposeDB. - What control do I have over this data? What's the catch? @@ -196,6 +183,19 @@ export const ComposeDBPromptModal: React.FC = ({ address you are connected with becomes the sole controller of that data. + + What data does this include? + + + MyMeta's ComposeDB model includes: + + {Object.values(profileMapping).map((field) => ( + {field} + ))} + + Note that skills and DAO memberships are currently not{' '} + being stored in ComposeDB. + diff --git a/packages/web/components/Setup/SetupAvailability.tsx b/packages/web/components/Setup/SetupAvailability.tsx index d62be504cb..4a25e3cc28 100644 --- a/packages/web/components/Setup/SetupAvailability.tsx +++ b/packages/web/components/Setup/SetupAvailability.tsx @@ -64,7 +64,7 @@ const SetupAvailabilityInput: React.FC = () => { formState: { errors }, } = useFormContext(); - const { ref: registerRef, ...props } = register(field, { + const { ...props } = register(field, { valueAsNumber: true, min: { value: 0, @@ -103,10 +103,6 @@ const SetupAvailabilityInput: React.FC = () => { borderRight={0} _focus={errors[field] ? { borderColor: 'red' } : undefined} autoFocus - ref={(ref) => { - ref?.focus(); - registerRef(ref); - }} {...props} /> diff --git a/packages/web/components/Setup/SetupDescription.tsx b/packages/web/components/Setup/SetupDescription.tsx index f3146c017e..27f432dcde 100644 --- a/packages/web/components/Setup/SetupDescription.tsx +++ b/packages/web/components/Setup/SetupDescription.tsx @@ -58,7 +58,7 @@ const DescriptionField: React.FC = () => { formState: { errors }, } = useFormContext(); - const { ref: registerRef, ...props } = register(field, { + const { ...props } = register(field, { maxLength: { value: 420, message: 'Maximum length is 420 characters.', @@ -74,10 +74,6 @@ const DescriptionField: React.FC = () => { color="white" _focus={errors[field] ? { borderColor: 'red' } : undefined} bg="dark" - ref={(ref) => { - ref?.focus(); - registerRef(ref); - }} {...props} /> diff --git a/packages/web/components/Setup/SetupName.tsx b/packages/web/components/Setup/SetupName.tsx index 03eaba8887..972e1956fc 100644 --- a/packages/web/components/Setup/SetupName.tsx +++ b/packages/web/components/Setup/SetupName.tsx @@ -53,7 +53,7 @@ const SetupNameInput: React.FC = () => { const { errors } = formState; - const { ref: registerRef, ...props } = register(field, { + const { ...props } = register(field, { required: 'We have to identify you somehow! 😱', maxLength: { value: 150, @@ -69,10 +69,6 @@ const SetupNameInput: React.FC = () => { placeholder="NAME" w="auto" _focus={errors[field] ? { borderColor: 'red' } : undefined} - ref={(ref) => { - ref?.focus(); - registerRef(ref); - }} {...props} /> diff --git a/packages/web/components/Setup/SetupProfilePicture.tsx b/packages/web/components/Setup/SetupProfilePicture.tsx index c2202e06c0..5abcba95b2 100644 --- a/packages/web/components/Setup/SetupProfilePicture.tsx +++ b/packages/web/components/Setup/SetupProfilePicture.tsx @@ -117,7 +117,6 @@ const SetupProfilePictureInput: React.FC<{ name="profileImageURL" accept="image/*" ref={(ref) => { - ref?.focus(); registerRef(ref); inputRef.current = ref; }}