Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 0001d9b

Browse files
authored
Merge branch 'main' into issue-11148
2 parents 3b0a555 + 5d9cf5c commit 0001d9b

File tree

10 files changed

+51
-8
lines changed

10 files changed

+51
-8
lines changed

components/TheFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ const menuKodadot: Menu[] = [
235235
236236
{
237237
name: $i18n.t('press kit'),
238-
url: 'https://github.com/kodadot/kodadot-presskit/tree/main/pre-v4',
238+
url: 'https://github.com/kodadot/kodadot-presskit/tree/main/v4',
239239
external: true,
240240
},
241241
{

components/gallery/GalleryItemAction/GalleryItemActionType/GalleryItemTrade.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
class="flex justify-end gallery-item-trade"
1010
>
1111
<NeoButton
12+
data-testid="gallery-item-trade-make-offer"
1213
:label="$t('transaction.offer')"
1314
variant="k-blue"
1415
size="large"

components/swap/GridList.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
grid-size="medium"
1212
:grid-section="gridSection"
1313
link-target="_blank"
14-
:hide-hover-action="!selectable"
14+
:hide-hover-action="!selectable || stepItems.length === MAX_AMOUNT_OF_SWAP_ITEMS"
1515
>
1616
<template
1717
v-if="surcharge"
@@ -31,6 +31,8 @@ import { type SwapSurcharge } from '@/composables/transaction/types'
3131
3232
const gridSection = GridSection.PROFILE_GALLERY
3333
34+
const MAX_AMOUNT_OF_SWAP_ITEMS = 1
35+
3436
const props = defineProps<{
3537
query: Record<string, any>
3638
selectable?: boolean
@@ -40,6 +42,7 @@ const props = defineProps<{
4042
4143
const route = useRoute()
4244
const { replaceUrl } = useReplaceUrl()
45+
const { stepItems } = storeToRefs(useAtomicSwapStore())
4346
4447
const collections = ref(route.query.collections?.toString().split(',').filter(Boolean) || [])
4548

composables/drop/massmint/useDropMassMint.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import type { Prefix } from '@kodadot1/static'
12
import type { ToMintNft } from '@/components/collection/drop/types'
2-
import { generateId, setDyndataUrl } from '@/services/dyndata'
3+
import { generateIdAssethub, setDyndataUrl } from '@/services/dyndata'
34

45
export type MassMintNFT = Omit<ToMintNft, 'priceUSD'> & {
56
image: string
@@ -18,7 +19,7 @@ export default () => {
1819
const tokenIds = ref<number[]>([])
1920
const populateTokenIds = async () => {
2021
for (const _ of Array.from({ length: amountToMint.value })) {
21-
const tokenId = Number.parseInt(await generateId())
22+
const tokenId = Number.parseInt(await generateIdAssethub(parseInt(drop.value.collection), usePrefix().urlPrefix.value as Prefix))
2223
if (!tokenIds.value.includes(tokenId)) {
2324
tokenIds.value.push(tokenId)
2425
}

composables/transaction/mintToken/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const lastIndexUsed = async (collection: MintedCollection, api) => {
104104
return Math.max(lastIndexUsed, lastOnChainIndex, 0)
105105
}
106106

107-
const getLastIndexUsedOnChain = async (api, collectionId) => {
107+
export const getLastIndexUsedOnChain = async (api, collectionId) => {
108108
const collectionItems = await api.query.nfts.item.entries(collectionId)
109109
const itemIds = collectionItems.map(([key]) => key.args[1].toNumber())
110110
return Math.max(...itemIds)

libs/ui/src/components/MediaItem/type/VideoMedia.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
playsinline
99
loop
1010
:autoplay="autoPlay"
11-
:muted="preview"
11+
muted
1212
:poster="src"
1313
:src="animationSrc || src"
1414
controlslist="nodownload"

locales/all_lang.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"href": "https://github.com/kodadot/nft-gallery/issues"
3434
},
3535
"presskit": {
36-
"href": "https://github.com/kodadot/kodadot-presskit/tree/main/v3"
36+
"href": "https://github.com/kodadot/kodadot-presskit/tree/main/v4"
3737
},
3838
"twitter": { "href": "https://twitter.com/kodadot" }
3939
},

services/dyndata.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import type { Prefix } from '@kodadot1/static'
2+
import { getLastIndexUsedOnChain } from '@/composables/transaction/mintToken/utils'
3+
14
const BASE_URL = isProduction
25
? 'https://dyndata.koda.art'
36
: 'https://dyndata-beta.koda.art'
@@ -6,6 +9,31 @@ const api = $fetch.create({
69
baseURL: BASE_URL,
710
})
811

12+
// store latest IDs for each collection
13+
const latestIdsMap = new Map<string, number>()
14+
15+
export const generateIdAssethub = async (collectionId: number, prefix?: Prefix) => {
16+
// 237 is the latest drops collection id to handle backwards compatibility
17+
if (collectionId <= 273 && prefix) {
18+
const mapKey = `${prefix}-${collectionId}`
19+
20+
// Always check the chain for the latest ID
21+
const { apiInstance } = useApi()
22+
const lastIdFromChain = await getLastIndexUsedOnChain(await apiInstance.value, collectionId)
23+
const currentStoredId = latestIdsMap.get(mapKey) || 0
24+
25+
// Use the larger of the two values to ensure we don't create duplicates
26+
const currentId = Math.max(lastIdFromChain, currentStoredId)
27+
const nextId = currentId + 1
28+
29+
// Store the new ID
30+
latestIdsMap.set(mapKey, nextId)
31+
return nextId.toString()
32+
}
33+
34+
return (await api('/generate-id')) as string
35+
}
36+
937
export const generateId = async () => {
1038
return (await api('/generate-id')) as string
1139
}

tests/e2e/footer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const footerLinks = [
4141
},
4242
{
4343
linkName: 'Press Kit',
44-
linkAddress: 'https://github.com/kodadot/kodadot-presskit/tree/main/pre-v4',
44+
linkAddress: 'https://github.com/kodadot/kodadot-presskit/tree/main/v4',
4545
},
4646
{
4747
linkName: 'MerchShop',

tests/e2e/offer.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { expect, test } from './fixtures'
2+
3+
test('show offer modal', async ({ page, Commands }) => {
4+
await Commands.e2elogin()
5+
await page.goto('/ahp/gallery/256-4235681345')
6+
await page.getByTestId('gallery-item-trade-make-offer').click()
7+
8+
// at least show the offer modal
9+
await expect(page.locator('.modal-card-title')).toHaveText('Create Offer')
10+
})

0 commit comments

Comments
 (0)