Skip to content

Commit

Permalink
update static ipfs url
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Jul 6, 2024
1 parent 8dab0b6 commit de5c080
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vue-app/src/components/IpfsImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</template>

<script setup lang="ts">
import { getIpfsUrl, getStaticAssetsUrlByIpfsHash } from '@/utils/url'
import { getIpfsUrl, getStaticUrlByIpfsHash } from '@/utils/url'
interface Props {
class?: string
Expand All @@ -16,7 +16,7 @@ const isStaticImageBroken = ref(false)
const props = defineProps<Props>()
const staticImageSrc = computed(() => getStaticAssetsUrlByIpfsHash(props.src) || '')
const staticImageSrc = computed(() => getStaticUrlByIpfsHash(props.src) || '')
const imageSrc = computed(() => getIpfsUrl(props.src) || '')
function handleBrokenStaticImage() {
Expand Down
1 change: 0 additions & 1 deletion vue-app/src/components/LeaderboardSimpleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import type { LeaderboardProject } from '@/api/projects'
import type { RoundInfo } from '@/api/round'
import { formatAmount } from '@/utils/amounts'
import { getStaticAssetsUrlByIpfsHash, getIpfsUrl } from '@/utils/url'
interface Props {
project: LeaderboardProject
Expand Down
4 changes: 2 additions & 2 deletions vue-app/src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export function getAssetsUrl(path) {
return new URL(`/src/assets/${path}`, import.meta.url).href
}

export function getStaticAssetsUrlByIpfsHash(hash): string | null {
return hash ? `/assets/ipfs/${hash}` : null
export function getStaticUrlByIpfsHash(hash): string | null {
return hash ? `/ipfs/${hash}` : null
}

export function getIpfsUrl(hash): string | null {
Expand Down

0 comments on commit de5c080

Please sign in to comment.