diff --git a/.changeset/ninety-goats-visit.md b/.changeset/ninety-goats-visit.md new file mode 100644 index 000000000..48fe5fade --- /dev/null +++ b/.changeset/ninety-goats-visit.md @@ -0,0 +1,5 @@ +--- +"nostrudel": patch +--- + +Fix bug with removing "about" in profile editor diff --git a/.github/workflows/deploy-next.yml b/.github/workflows/deploy-next.yml index a0bd13577..568004516 100644 --- a/.github/workflows/deploy-next.yml +++ b/.github/workflows/deploy-next.yml @@ -11,9 +11,6 @@ concurrency: jobs: deploy: runs-on: ubuntu-latest - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -29,24 +26,16 @@ jobs: - name: Install Dependencies run: pnpm install + - name: Set build env + run: | + echo "VITE_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV + - name: Build run: pnpm build - name: Redirect 404 to Index for SPA run: cp dist/index.html dist/404.html - # - name: Deploy - # uses: reggionick/s3-deploy@v4 - # with: - # folder: dist - # bucket: "${{ secrets.S3_BUCKET }}" - # bucket-region: us-east-1 - # dist-id: "${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}" - # invalidation: / - # delete-removed: true - # no-cache: true - # private: true - # files-to-include: "{.*/**,**}" - - name: Deploy nsite run: npx -y nsite-cli upload dist --verbose --purge --privatekey ${{ secrets.NSITE_KEY }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 100dff837..9d2905b37 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -50,8 +50,8 @@ jobs: - name: Set build env run: | - echo "VITE_COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV - echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV + echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV - name: Build and push Docker image uses: docker/build-push-action@v5 @@ -61,3 +61,6 @@ jobs: platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + COMMIT_HASH=$COMMIT_HASH + APP_VERSION=$APP_VERSION diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2d6d3aa35..3a2968085 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -45,7 +45,7 @@ jobs: - name: Set build env run: | - echo "VITE_COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV + echo "VITE_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV - name: Build diff --git a/dockerfile b/dockerfile index 17f34b055..43ad054e1 100644 --- a/dockerfile +++ b/dockerfile @@ -16,8 +16,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile -ENV VITE_COMMIT_HASH="" -ENV VITE_APP_VERSION="Custom" +ARG COMMIT_HASH="" +ARG APP_VERSION="" +ENV VITE_COMMIT_HASH="$COMMIT_HASH" +ENV VITE_APP_VERSION="$APP_VERSION" COPY tsconfig.json . COPY index.html . diff --git a/package.json b/package.json index da3f87e04..82a4fed9b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "start": "vite serve", - "dev": "VITE_APP_VERSION=production vite serve", + "dev": "VITE_APP_VERSION=dev vite serve", "build": "tsc --project tsconfig.json && vite build", "format": "prettier --ignore-path .prettierignore -w .", "analyze": "npx vite-bundle-visualizer -o ./stats.html", diff --git a/src/components/version-button.tsx b/src/components/version-button.tsx index b38c06b4a..81fcbcbdb 100644 --- a/src/components/version-button.tsx +++ b/src/components/version-button.tsx @@ -11,7 +11,7 @@ export default function VersionButton({ ...props }: Omit : } onClick={() => { @@ -23,7 +23,7 @@ export default function VersionButton({ ...props }: Omit - Version: {version} + {version} ); } diff --git a/src/views/profile/edit.tsx b/src/views/profile/edit.tsx index 50b94068b..d6f25c5aa 100644 --- a/src/views/profile/edit.tsx +++ b/src/views/profile/edit.tsx @@ -224,10 +224,10 @@ export const ProfileEditView = () => { picture: data.picture, banner: data.banner, }; - if (data.displayName) newMetadata.displayName = newMetadata.display_name = data.displayName; - if (data.about) newMetadata.about = data.about; - if (data.website) newMetadata.website = data.website; - if (data.nip05) newMetadata.nip05 = data.nip05; + if (data.displayName !== undefined) newMetadata.displayName = newMetadata.display_name = data.displayName; + if (data.about !== undefined) newMetadata.about = data.about; + if (data.website !== undefined) newMetadata.website = data.website; + if (data.nip05 !== undefined) newMetadata.nip05 = data.nip05; if (data.lightningAddress) { if (isLNURL(data.lightningAddress)) {