Skip to content

Commit

Permalink
redundant code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Oct 6, 2024
1 parent 4d9d5cc commit f55ca29
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 61 deletions.
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ Iggy Social is a Web3 Social frontend website based on the [Iggy Social](https:/
Demo 1 (Netlify): https://demo.iggy.social/
Demo 2 (Vercel): https://demo2.iggy.social/

## Add Arweave info

To support posts/comments & image uploads, create an Arweave Wallet (e.g. here: https://arweave.app/) and send some AR to it.

Then go to the wallet settings and download Backup Keyfile.

In this file you'll find 10 different variables, enter these into your .env file:

```bash
ARWEAVE_KTY=
ARWEAVE_N=
ARWEAVE_E=
ARWEAVE_D=
ARWEAVE_P=
ARWEAVE_Q=
ARWEAVE_DP=
ARWEAVE_DQ=
ARWEAVE_QI=
```

And add the arweave address too:

```bash
ARWEAVE_ADDRESS=
```

Also make sure these variables are set on your hosting provider (Netlify, Vercel, etc).

## Delete mirror.yml in the .github folder

The mirror.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.
Expand Down Expand Up @@ -62,34 +90,6 @@ If you want to have GIF search implemented, create your own Tenor API Key on Goo

Then enter the key in environment variables (`TENOR_KEY`).

## Image upload (Arweave)

To support image uploads, create an Arweave Wallet (e.g. here: https://arweave.app/) and send some AR to it.

Then go to the wallet settings and download Backup Keyfile.

In this file you'll find 10 different variables, enter these into your .env file:

```bash
ARWEAVE_KTY=
ARWEAVE_N=
ARWEAVE_E=
ARWEAVE_D=
ARWEAVE_P=
ARWEAVE_Q=
ARWEAVE_DP=
ARWEAVE_DQ=
ARWEAVE_QI=
```

And add the arweave address too:

```bash
ARWEAVE_ADDRESS=
```

Also make sure these variables are set on your hosting provider (Netlify, Vercel, etc).

## ImageKit upload

It is recommended to use ImageKit as the fallback option, in case Arweave has technical issues.
Expand Down
4 changes: 2 additions & 2 deletions plugins/chain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ethers } from 'ethers'

export default defineNuxtPlugin(() => {
const config = useRuntimeConfig() // access env vars like this: config.alchemyPolygonKey
//const config = useRuntimeConfig() // access env vars like this: config.alchemyPolygonKey

function getChainName(chainId) {
let chain = chains.find(chain => chain.chainId == chainId)
Expand Down Expand Up @@ -121,7 +121,7 @@ const chains = [
{
chainId: 137,
name: 'Polygon',
currency: 'MATIC',
currency: 'POL',
rpcs: ['https://rpc.ankr.com/polygon'],
blockExplorer: 'https://polygonscan.com',
},
Expand Down
35 changes: 4 additions & 31 deletions store/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ export const useUserStore = defineStore({
address: null,
chatTokenBalanceWei: BigInt(0),
defaultDomain: null,
followers: 0,
following: 0,
lastActivityTimestamp: null,
lpTokenBalanceWei: BigInt(0),
image: null,
stakeTokenBalanceWei: BigInt(0), // receipt token from the staking contract (aka governance token)
Expand Down Expand Up @@ -44,26 +41,14 @@ export const useUserStore = defineStore({
return state.defaultDomain
},

getFollowers(state) {
return state.followers
},

getFollowing(state) {
return state.following
},

getLastActivityTimestamp(state) {
return state.lastActivityTimestamp
getImage(state) {
return state.image
},

getLpTokenBalanceWei(state) {
return ethers.BigNumber.from(state.lpTokenBalanceWei)
},

getImage(state) {
return state.image
},

getStakeTokenBalanceWei(state) {
return ethers.BigNumber.from(state.stakeTokenBalanceWei)
},
Expand Down Expand Up @@ -98,26 +83,14 @@ export const useUserStore = defineStore({
this.defaultDomain = domain
},

setFollowers(followers: any) {
this.followers = followers
},

setFollowing(following: any) {
this.following = following
},

setLastActivityTimestamp(timestamp: any) {
this.lastActivityTimestamp = timestamp
setImage(image: any) {
this.image = image
},

setLpTokenBalanceWei(balance: ethers.BigNumber) {
this.lpTokenBalanceWei = balance.toBigInt()
},

setImage(image: any) {
this.image = image
},

setStakeTokenBalanceWei(balance: ethers.BigNumber) {
this.stakeTokenBalanceWei = balance.toBigInt()
},
Expand Down

0 comments on commit f55ca29

Please sign in to comment.