Fix default port on hub invites

This commit is contained in:
Jacob Karlsson 2024-04-17 13:05:39 +02:00
parent 047718beb4
commit 9e679b5902
1 changed files with 3 additions and 1 deletions

View File

@ -135,10 +135,12 @@ async function writeElements(ev, elements) {
async function createInvite() { async function createInvite() {
if (globalAccountID === null) throw new Error('account not loaded') if (globalAccountID === null) throw new Error('account not loaded')
const { url } = await p(peer.invite.createForFriend)({ let { url } = await p(peer.invite.createForFriend)({
hubs: 1, hubs: 1,
id: globalAccountID, id: globalAccountID,
}) })
// if the hub is on localhost, it's probably on the default port of 3000, so let's make things a bit easier for the user
if (url.indexOf('0.0.0.0') !== -1) url = url.replace("0.0.0.0", "0.0.0.0:3000")
return url return url
} }