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

Commit a1f612a

Browse files
authored
Merge pull request #180 from kodadot/meta
Fixed migration for one nft
2 parents e2add9e + 249ce28 commit a1f612a

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

dashboard/src/components/rmrk/Create/CreateItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<b-switch v-model="isImage"
4747
passive-type="is-dark"
4848
:rounded="false">
49-
{{ isImage ? 'Static Image' : 'Animated multimedia' }}
49+
{{ isImage ? 'Image / GIF' : 'Animated multimedia' }}
5050
</b-switch>
5151
</b-field>
5252
<MetadataUpload v-if="isImage" v-model="image" :label="$i18n.t('Click to add image')" />

dashboard/src/components/rmrk/service/RmrkService.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,27 @@ export class RmrkService extends TextileService<RmrkType> implements State {
520520
this.useNFT()
521521
return this.findAll()
522522
}
523+
524+
public async updateCollectionWithMeta(id: string) {
525+
try {
526+
const collection = await this.getCollectionById(id)
527+
const final = await migrateCollection(collection)
528+
await this.update(final)
529+
} catch (e) {
530+
console.warn(`[RMRK Service] Unable to update collection with Meta ${e.message}`)
531+
}
532+
}
533+
534+
public async updateNFTWithMeta(id: string) {
535+
try {
536+
this.useNFT();
537+
const nft = await this.getNFT(id)
538+
const final = await migrateNFT(nft)
539+
await this.update(final)
540+
} catch (e) {
541+
console.warn(`[RMRK Service] Unable to update collection with Meta ${e.message}`)
542+
}
543+
}
523544
}
524545

525546

dashboard/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import MetaInfo from 'vue-meta';
1717
Vue.use(MetaInfo)
1818
import Connector from '@vue-polkadot/vue-api';
1919
import { client, keyInfo } from '@/textile'
20-
import { createInstance, getInstance } from '@/components/rmrk/service/RmrkService'
20+
import { createInstance, getInstance, migrateCollection, migrateNFT } from '@/components/rmrk/service/RmrkService'
2121
import { enableExtension } from './extension'
2222
import { web3FromAddress } from '@polkadot/extension-dapp';
2323
import { getPrefixByStoreUrl } from '@/utils/chain'

0 commit comments

Comments
 (0)