Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
fix: print screen original url (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntheile authored Aug 25, 2023
1 parent 0c6fe3c commit a58540c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"lnurl-pay": "^1.0.1",
"lodash.debounce": "^4.0.8",
"next": "^13.4.19",
"original-url": "^1.2.3",
"react": "^18.2.0",
"react-bootstrap": "^1.6.4",
"react-currency-input-field": "^3.6.10",
Expand All @@ -55,6 +56,7 @@
"@types/eslint": "^8.2.0",
"@types/lodash.debounce": "^4.0.6",
"@types/node": "^20.2.5",
"@types/original-url": "^1.2.0",
"@types/prettier": "^2.7.0",
"@types/react": "^17.0.30",
"@types/react-dev-utils": "^9.0.11",
Expand Down
5 changes: 4 additions & 1 deletion pages/[username]/print.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { QRCode } from "react-qrcode-logo"
import { useRef } from "react"
import { URL_HOST_DOMAIN } from "../../config/config"
import { NextRequest } from "next/server"
import originalUrl from "original-url"

export async function getServerSideProps({
req,
Expand All @@ -16,7 +17,9 @@ export async function getServerSideProps({
req: NextRequest
params: { username: string }
}) {
const url = new URL(req.url)
// eslint-disable-next-line
// @ts-ignore
const url = originalUrl(req)

const lnurl = bech32.encode(
"lnurl",
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2037,6 +2037,13 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67"
integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==

"@types/original-url@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@types/original-url/-/original-url-1.2.0.tgz#850d207280da5c3a0244fd16f581db41dbd92c0c"
integrity sha512-nYjnhHQQUex9WdZH13ZbEJ6gNkoyrjSXfFjZAvjjHr38I7FKYMJVGj9NfYIPpH6U5WC+eQyB0V4J43DS37/LtQ==
dependencies:
"@types/node" "*"

"@types/parse-json@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
Expand Down Expand Up @@ -4158,6 +4165,11 @@ form-data@^4.0.0:
combined-stream "^1.0.8"
mime-types "^2.1.12"

forwarded-parse@^2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/forwarded-parse/-/forwarded-parse-2.1.2.tgz#08511eddaaa2ddfd56ba11138eee7df117a09325"
integrity sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==

fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
Expand Down Expand Up @@ -5644,6 +5656,13 @@ ora@^5.4.1:
strip-ansi "^6.0.0"
wcwidth "^1.0.1"

original-url@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/original-url/-/original-url-1.2.3.tgz#133aff4b2d27e38a98d736f7629c56262b7153e1"
integrity sha512-BYm+pKYLtS4mVe/mgT3YKGtWV5HzN/XKiaIu1aK4rsxyjuHeTW9N+xVBEpJcY1onB3nccfH0RbzUEoimMqFUHQ==
dependencies:
forwarded-parse "^2.1.0"

os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
Expand Down

0 comments on commit a58540c

Please sign in to comment.