Skip to content

Commit 0542057

Browse files
authored
Merge pull request #30 from nexus-uw/nexus-uw-patch-1
Update noteSaved.js - all params from hash
2 parents d7ae2f1 + dc7358d commit 0542057

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

resources/js/noteSaved.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ import QRCode from 'qrcode'
44
export class NoteSaved {
55

66
constructor() {
7-
const hash = window.location.hash.slice(1)
8-
const id = new URLSearchParams(window.location.search).get('id')
7+
8+
const ff = new URLSearchParams(window.location.hash.slice(1))
9+
const hash = ff.get('hash')
10+
const id = ff.get('id')
11+
912

1013
const clearnetShareLink = `${document.querySelector('meta[name="clearnet"]').getAttribute('content')}/decrypt/${id}#${hash}`
1114
document.getElementById('clearnetShareLink').href = clearnetShareLink
@@ -18,4 +21,4 @@ export class NoteSaved {
1821
QRCode.toCanvas(document.getElementById('darknetShareQR'), dakrnetShareLink)
1922
])
2023
}
21-
}
24+
}

resources/js/service-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ self.addEventListener("fetch", (event) => {
6060
})
6161
)
6262
// respond with saved note page
63-
return Response.redirect(`/noteSaved?id=${id}#${hash}`, 303)
63+
return Response.redirect(`/noteSaved#id=${id}&hash=${hash}`, 303)
6464
})(),
6565
)
6666
})

0 commit comments

Comments
 (0)