fix(lib): fix missing secret bug (#430)

This commit is contained in:
Anton Tranelis 2025-11-11 11:05:53 +01:00 committed by GitHub
parent 2ee10f0f55
commit 8391532d83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -33,9 +33,10 @@ export const useNavigationUrl = (coordinates?: [number, number]) => {
export const useShareLogic = (item?: Item) => { export const useShareLogic = (item?: Item) => {
const shareUrl = window.location.href const shareUrl = window.location.href
const shareTitle = item?.name ?? 'Utopia Map Item' const shareTitle = item?.name ?? 'Utopia Map Item'
const inviteLink = item?.secrets const inviteLink =
? `${window.location.origin}/invite/${item.secrets[0].secret}` item?.secrets && item.secrets.length > 0
: shareUrl ? `${window.location.origin}/invite/${item.secrets[0].secret}`
: shareUrl
const copyLink = () => { const copyLink = () => {
navigator.clipboard navigator.clipboard

View File

@ -85,7 +85,9 @@ export function HeaderView({
onConfirm={deleteCallback ?? (() => undefined)} onConfirm={deleteCallback ?? (() => undefined)}
/> />
<QRModal item={item} isOpen={qrModalOpen} onClose={() => setQrModalOpen(false)} /> {showQrButton && (
<QRModal item={item} isOpen={qrModalOpen} onClose={() => setQrModalOpen(false)} />
)}
</> </>
) )
} }