diff --git a/.github/workflows/calimero_node_linux.yml b/.github/workflows/calimero_node_linux.yml index be76117bf..ba53c4b14 100644 --- a/.github/workflows/calimero_node_linux.yml +++ b/.github/workflows/calimero_node_linux.yml @@ -128,6 +128,7 @@ jobs: create_release: runs-on: ubuntu-latest needs: build + if: ${{ github.ref == 'refs/heads/master' || (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master') }} outputs: release_exists: ${{ steps.check_release.outputs.release_exists }} version: ${{ needs.build.outputs.version }} diff --git a/.github/workflows/calimero_node_macos.yml b/.github/workflows/calimero_node_macos.yml index 453d62611..34aa5fcdb 100644 --- a/.github/workflows/calimero_node_macos.yml +++ b/.github/workflows/calimero_node_macos.yml @@ -105,7 +105,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - if gh release view "v${{ github.event.inputs.version }}" >/dev/null 2>&1; then + VERSION=${{ needs.build.outputs.version }} + if gh release view "v$VERSION" >/dev/null 2>&1; then echo "release_exists=true" >> $GITHUB_ENV else echo "release_exists=false" >> $GITHUB_ENV diff --git a/README.mdx b/README.mdx index 8b954492b..2822dc99f 100644 --- a/README.mdx +++ b/README.mdx @@ -1,8 +1,6 @@ # Welcome to Calimero [![Discord](https://dcbadge.vercel.app/api/server/urJeMtRRMu?style=flat&theme=default-inverted)](https://discord.gg/urJeMtRRMu) -[![Telegram Group](https://img.shields.io/badge/Join-Telegram%20Group-blue.svg?logo=telegram)](https://t.me/+_6h-gJlnXO83OGVk) -[![Docs deploy gh action](https://github.com/calimero-network/core/actions/workflows/docusaurus_deploy.yml/badge.svg)](https://github.com/calimero-network/core/actions/workflows/docusaurus_deploy.yml) [![SDK publish gh action](https://github.com/calimero-network/core/actions/workflows/calimero_sdk_publish.yml/badge.svg)](https://github.com/calimero-network/core/actions/workflows/calimero_sdk_publish.yml) [![npm version](https://badge.fury.io/js/@calimero-is-near%2Fcalimero-p2p-sdk.svg)](https://badge.fury.io/js/@calimero-is-near%2Fcalimero-p2p-sdk) [![License](https://img.shields.io/badge/License-Apache--2.0-blue)](#license) diff --git a/packages/calimero-sdk/package.json b/packages/calimero-sdk/package.json index d25359e7c..f87970642 100644 --- a/packages/calimero-sdk/package.json +++ b/packages/calimero-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@calimero-is-near/calimero-p2p-sdk", - "version": "0.0.20", + "version": "0.0.21", "description": "Javascript library to interact with Calimero P2P node", "type": "module", "main": "lib/index.js", diff --git a/packages/calimero-sdk/src/setup/SetupModal.tsx b/packages/calimero-sdk/src/setup/SetupModal.tsx index 16b4115ee..c99b3b064 100644 --- a/packages/calimero-sdk/src/setup/SetupModal.tsx +++ b/packages/calimero-sdk/src/setup/SetupModal.tsx @@ -1,4 +1,4 @@ -import { useCallback, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import apiClient from '../api'; import React from 'react'; import Spinner from '../components/loader/Spinner'; @@ -87,9 +87,13 @@ export const SetupModal: React.FC = ( ) => { const [error, setError] = useState(null); const [loading, setLoading] = useState(false); - const [url, setUrl] = useState(props.getNodeUrl()); + const [url, setUrl] = useState(null); const MINIMUM_LOADING_TIME_MS = 1000; + useEffect(() => { + setUrl(props.getNodeUrl()); + }, [props]); + function validateUrl(value: string): boolean { try { new URL(value);