Skip to content

Commit

Permalink
add image to collection modal: add id to input field and key to the i…
Browse files Browse the repository at this point in the history
…mg element
  • Loading branch information
tempe-techie committed Nov 29, 2023
1 parent 16e8d00 commit e5e080d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/nft/collection/AddImageToCollectionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

<p v-if="!$config.fileUploadEnabled">Paste image link here:</p>

<input v-model="imageUrl" type="text" class="form-control">
<input v-model="imageUrl" type="text" class="form-control" id="addImageToCollectionInput" />

<div v-if="imageUrl" class="mt-3">
<img :src="imageUrl" class="img-thumbnail img-fluid" style="max-width: 100px;" />
<img :src="imageUrl" :key="imageUrl" class="img-thumbnail img-fluid" style="max-width: 100px;" />
<br />
<small>If image didn't appear above, then something is wrong with the link you added.</small>
</div>
Expand Down
8 changes: 6 additions & 2 deletions pages/nft/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export default {
// create launchpad contract object
const launchpadInterface = new ethers.utils.Interface([
"function getLastNftContracts(uint256 amount) external view returns(address[] memory)",
"function getNftContracts(uint256 fromIndex, uint256 toIndex) external view returns(address[] memory)",
"function getNftContractsArrayLength() external view returns(uint256)"
]);
Expand All @@ -177,11 +178,14 @@ export default {
);
// get all NFTs array length
if (this.allNftsArrayLength === 0) {
if (Number(this.allNftsArrayLength) === 0) {
this.allNftsArrayLength = await launchpadContract.getNftContractsArrayLength();
}
if (this.allNftsArrayLength > 0) {
if (Number(this.allNftsArrayLength) === 1) {
const lNfts = await launchpadContract.getLastNftContracts(1);
await this.parseNftsArray(lNfts, this.lastNfts, provider);
} else if (Number(this.allNftsArrayLength) > 1) {
// set the start and end index, if end index is 0
if (this.allNftsIndexEnd === 0) {
this.allNftsIndexEnd = this.allNftsArrayLength - 1;
Expand Down

0 comments on commit e5e080d

Please sign in to comment.