Skip to content

Commit

Permalink
Merge branch 'main' into feature/locales/order
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo authored Sep 30, 2024
2 parents a0011c7 + 6788b37 commit ad25851
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 24 deletions.
6 changes: 4 additions & 2 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
</nuxt-link>

<MobileExpandableSection
v-if="isExplorerVisible"
v-slot="{ onCloseMobileSubMenu }"
class="lg:!hidden"
:title="$t('explore')"
Expand All @@ -130,6 +131,7 @@
/>
</MobileExpandableSection>
<NavbarExploreDropdown
v-if="isExplorerVisible"
class="navbar-explore custom-navbar-item max-lg:!hidden"
data-testid="explore"
/>
Expand Down Expand Up @@ -259,10 +261,9 @@ import NavbarChainOptions from '@/components/navbar/NavbarChainOptions.vue'
import NavbarExploreOptions from '@/components/navbar/NavbarExploreOptions.vue'
import Search from '@/components/search/Search.vue'
import ConnectWalletButton from '@/components/shared/ConnectWalletButton.vue'
import { explorerVisible, createVisible } from '@/utils/config/permission.config'
import { useIdentityStore } from '@/stores/identity'
import { getChainNameByPrefix } from '@/utils/chain'
import { createVisible } from '@/utils/config/permission.config'
const { neoModal } = useProgrammatic()
const openMobileSearchBar = ref(false)
Expand All @@ -280,6 +281,7 @@ const mobilSearchRef = ref<{ focusInput: () => void } | null>(null)
const account = computed(() => identityStore.getAuthAddress)
const isCreateVisible = computed(() => createVisible(urlPrefix.value))
const isExplorerVisible = computed(() => explorerVisible(urlPrefix.value))
const logoSrc = computed(() => {
const variant = isTouch ? 'Koda' : 'Koda_Beta'
Expand Down
3 changes: 2 additions & 1 deletion composables/drop/useGenerativeDropMint.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isEthereumAddress } from '@polkadot/util-crypto'
import { type DoResult, updateMetadata } from '@/services/fxart'
import { useDrop } from '@/components/drops/useDrops'
import useDropMassMintListing from '@/composables/drop/massmint/useDropMassMintListing'
Expand Down Expand Up @@ -65,7 +66,7 @@ export const useUpdateMetadata = async ({
useSubscriptionGraphql({
query: `
nfts: nftEntities(
where: {collection: {id_eq: "${drop.value.collection}"}, blockNumber_eq: "${blockNumber.value}", currentOwner_eq: "${accountId.value}"},
where: {collection: {id_eq: "${drop.value.collection}"}, blockNumber_eq: "${blockNumber.value}", currentOwner_eq: "${isEthereumAddress(accountId.value) ? accountId.value.toLowerCase() : accountId.value}"},
orderBy: [createdAt_ASC, sn_ASC]
) {
id
Expand Down
2 changes: 1 addition & 1 deletion composables/transaction/transactionMintDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async function execEvmMintDrop({ executeTransaction }: EvmMintDropParams) {
abi,
arg,
functionName,
value: drop.value.price,
value: String(Number(drop.value.price) * amountToMint.value),
})
}

Expand Down
31 changes: 16 additions & 15 deletions composables/useUpdateProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ export default async ({
hasProfile: boolean
useFarcaster: boolean
}) => {
const imageUrl = profileData.image
? await uploadProfileImage({
file: profileData.image,
type: 'image',
signaturePair,
})
: profileData.imagePreview

const bannerUrl = profileData.banner
? await uploadProfileImage({
file: profileData.banner,
type: 'banner',
signaturePair,
})
: profileData.bannerPreview
const [imageUrl, bannerUrl] = await Promise.all([
profileData.image
? uploadProfileImage({
file: profileData.image,
type: 'image',
signaturePair,
})
: Promise.resolve(profileData.imagePreview),
profileData.banner
? uploadProfileImage({
file: profileData.banner,
type: 'banner',
signaturePair,
})
: Promise.resolve(profileData.bannerPreview),
])

const profileBody: CreateProfileRequest | UpdateProfileRequest = {
address: profileData.address,
Expand Down
6 changes: 1 addition & 5 deletions middleware/prefix.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ export default defineNuxtRouteMiddleware((route) => {
const { setUrlPrefix, urlPrefix } = usePrefix()

const isAnyChainPrefixInPath = chainPrefixes.includes(prefixInPath)

if (['rmrk', 'ksm', 'dot'].some(prefix => [urlPrefix.value, prefixInPath].includes(prefix as Prefix))
&& route.name !== 'prefix-transfer'
) {
setUrlPrefix('ahp')
location.replace(location.href.replace(prefixInPath, 'ahp'))
return
}

if (
else if (
urlPrefix.value !== prefixInPath
&& prefixInPath
&& isAnyChainPrefixInPath
Expand Down
4 changes: 4 additions & 0 deletions middleware/redirects.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default defineNuxtRouteMiddleware((route) => {
return accountId.value ? `/${urlPrefix.value}/u/${accountId.value}` : `/${urlPrefix.value}`
},
},
{
cond: (val: string) => ['ksm', 'rmrk', 'dot'].some(prefix => val.startsWith(`/${prefix}`) && !val.startsWith(`/${prefix}/transfer`)),
replaceValue: () => `/ahp`,
},
{
cond: (val: string) =>
val.startsWith(`/${urlPrefix.value}`) && val.endsWith('collections'),
Expand Down
2 changes: 2 additions & 0 deletions utils/config/permission.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const hasMassmintCreate: PartialConfig = {

const hasExplorer: PartialConfig = {
dot: false,
rmrk: false,
ksm: false,
}

export const createVisible = (prefix: Prefix | string): boolean => {
Expand Down

0 comments on commit ad25851

Please sign in to comment.