Skip to content

Commit

Permalink
netlify config, don't load last NFTs if there's none
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Oct 4, 2023
1 parent 0ccee7e commit 5003d51
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Iggy Social Template

Iggy Social is a Web3 Social frontend website based on the Iggy Social template. It uses [Orbis SDK](https://github.com/OrbisWeb3/orbis-sdk) and Ceramic Network in the background.
Iggy Social is a Web3 Social frontend website based on the [Iggy Social](https://iggy.social) template. It uses [Orbis SDK](https://useorbis.com) and [Ceramic Network](https://ceramic.network/) in the background. For usernames it uses [Punk Domains](https://punk.domains/).

Demo 1 (Netlify): https://demo.iggy.social/
Demo 2 (Vercel): https://demo2.iggy.social/

What's included:
## Delete the .github folder

- [Orbis SDK](https://github.com/OrbisWeb3/orbis-sdk)
- [Nuxt 3](https://v3.nuxtjs.org/)
- [Vue Dapp](https://vue-dapp-docs.netlify.app/)
- [Ethers 5](https://ethers.org/)
- [Pinia](https://pinia.vuejs.org/)
- [Vue Toastification](https://github.com/Maronato/vue-toastification/tree/next)
This folder (and the main.yml file) is just for the purpose of mirroring this repo to other git servers (for backup reasons). You don't need this in your cloned project.

## .env

Expand Down
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
publish = "dist"
command = "npm run generate"
50 changes: 26 additions & 24 deletions pages/nft/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,36 +181,38 @@ export default {
this.allNftsArrayLength = await launchpadContract.getNftContractsArrayLength();
}
// set the start and end index, if end index is 0
if (this.allNftsIndexEnd === 0) {
this.allNftsIndexEnd = this.allNftsArrayLength - 1;
if (this.allNftsArrayLength < this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexStart = 0;
} else {
this.allNftsIndexStart = this.allNftsArrayLength - this.$config.nftLaunchpadLatestItems;
if (this.allNftsArrayLength === 0) {
// set the start and end index, if end index is 0
if (this.allNftsIndexEnd === 0) {
this.allNftsIndexEnd = this.allNftsArrayLength - 1;
if (this.allNftsArrayLength < this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexStart = 0;
} else {
this.allNftsIndexStart = this.allNftsArrayLength - this.$config.nftLaunchpadLatestItems;
}
}
}
// get last NFTs
const lNfts = await launchpadContract.getNftContracts(this.allNftsIndexStart, this.allNftsIndexEnd);
const lNftsWritable = [...lNfts]; // copy the lNfts array to make it writable (for reverse() method)
// get last NFTs
const lNfts = await launchpadContract.getNftContracts(this.allNftsIndexStart, this.allNftsIndexEnd);
const lNftsWritable = [...lNfts]; // copy the lNfts array to make it writable (for reverse() method)
// reverse the lNftsWritable array (to show the latest NFTs first)
lNftsWritable.reverse();
// reverse the lNftsWritable array (to show the latest NFTs first)
lNftsWritable.reverse();
await this.parseNftsArray(lNftsWritable, this.lastNfts, provider);
await this.parseNftsArray(lNftsWritable, this.lastNfts, provider);
if (this.allNftsIndexEnd > this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexEnd = this.allNftsIndexEnd - this.$config.nftLaunchpadLatestItems;
} else {
this.allNftsIndexEnd = 0;
}
if (this.allNftsIndexEnd > this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexEnd = this.allNftsIndexEnd - this.$config.nftLaunchpadLatestItems;
} else {
this.allNftsIndexEnd = 0;
}
if (this.allNftsIndexStart > this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexStart = this.allNftsIndexStart - this.$config.nftLaunchpadLatestItems;
} else {
this.allNftsIndexStart = 0;
if (this.allNftsIndexStart > this.$config.nftLaunchpadLatestItems) {
this.allNftsIndexStart = this.allNftsIndexStart - this.$config.nftLaunchpadLatestItems;
} else {
this.allNftsIndexStart = 0;
}
}
this.waitingData = false;
Expand Down

1 comment on commit 5003d51

@vercel
Copy link

@vercel vercel bot commented on 5003d51 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.