Skip to content

Commit 74a71bc

Browse files
authored
add position to mobile qr (#1328)
1 parent d2f6f0a commit 74a71bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/@dcl/sdk-commands/src/commands/start/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export async function main(options: Options) {
264264
}
265265

266266
if (options.args['--mobile'] && lanUrl) {
267-
const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x}%2C${baseCoords.y}`
267+
const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x},${baseCoords.y}`
268268
QRCode.toString(deepLink, { type: 'terminal', small: true }, (err, qr) => {
269269
if (!err) {
270270
components.logger.log(colors.bold('\nScan to preview on mobile: \n'))

packages/@dcl/sdk-commands/src/commands/start/server/routes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export async function wireRouter(components: PreviewComponents, workspace: Works
3333
})
3434

3535
const localSceneParcels: string[] = []
36+
const baseParcel = workspace.projects[0].scene.scene.base
3637
for (const project of workspace.projects) {
3738
for (const parcel of project.scene.scene.parcels) {
3839
localSceneParcels.push(parcel)
@@ -49,7 +50,8 @@ export async function wireRouter(components: PreviewComponents, workspace: Works
4950
}
5051
}
5152

52-
const deepLink = `decentraland://open?preview=${lanUrl}`
53+
const [x, y] = baseParcel.split(',')
54+
const deepLink = `decentraland://open?preview=${lanUrl}&position=${x},${y}`
5355
const qrDataUrl = await QRCode.toDataURL(deepLink)
5456

5557
return {

0 commit comments

Comments
 (0)