Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
poolsar42 committed Jan 13, 2023
1 parent ca4c535 commit 06a753c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions apps/profile/app/routes/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ export const loader = async ({ request }) => {
).ensAddress || ''
}

// const orderedLinks = Array.from(Array(links.length))
// links?.forEach((link) => (orderedLinks[links.links_order] = link))

console.log(links)

return json({
targetAddress,
pfp,
address,
avatarUrl,
isToken,
links,
// links: orderedLinks,
})
}

Expand Down
14 changes: 8 additions & 6 deletions apps/profile/app/routes/account/settings/links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import { Button } from '@kubelt/design-system/src/atoms/buttons/Button'
import { Text } from '@kubelt/design-system/src/atoms/text/Text'
import { Tooltip } from 'flowbite-react'

import SortApp from '~/components/nft-collection/Check'
import InputText from '~/components/inputs/InputText'
import SaveButton from '~/components/accounts/SaveButton'

Expand Down Expand Up @@ -81,11 +80,11 @@ export const action: ActionFunction = async ({ request }) => {
const remainedLinks: any = JSON.parse(formData.get('links'))

const updatedLinks: any = remainedLinks.concat(
updatedNames.map((name: string, i: number) => ({
name,
url: updatedUrls[i],
verified: false,
}))
updatedNames.map((name: string, i: number) => {
console.log('HELLO MAN')
console.log(i)
return { name, url: updatedUrls[i], verified: false, links_order: i }
})
)

const errors = {}
Expand All @@ -111,6 +110,8 @@ export const action: ActionFunction = async ({ request }) => {
return { errors }
}

console.log('FROM LINKS', updatedLinks)

const galaxyClient = await getGalaxyClient()
const profileRes = await galaxyClient.getProfile(undefined, {
'KBT-Access-JWT-Assertion': jwt,
Expand Down Expand Up @@ -256,6 +257,7 @@ export default function AccountSettingsLinks() {

return arrayMove(links, oldIndex, newIndex)
})
setFormChanged(true)
}
setActiveId(null)
setActiveLink(null)
Expand Down
2 changes: 2 additions & 0 deletions platform/galaxy/src/schema/resolvers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const profileResolvers: Resolvers = {
let accountProfile = await accountClient.getProfile.query({
account: accountURN,
})
console.log('form Profile', accountProfile)
return accountProfile
},
profileFromAddress: async (
Expand All @@ -50,6 +51,7 @@ const profileResolvers: Resolvers = {
'X-3RN': addressURN,
},
})
console.log('From resolver', addressURN)
const accountURN = await addressClient.getAccount.query()

// return the address profile if no account is associated with the address
Expand Down

0 comments on commit 06a753c

Please sign in to comment.