Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggesting a variable name change from userHex to userPublicKey #2

Closed
melvincarvalho opened this issue Apr 19, 2023 · 0 comments
Closed

Comments

@melvincarvalho
Copy link
Contributor

I've reviewed the code in the main HTML file and would like to suggest a variable name change to improve code readability and understanding.

Current variable name: userHex
Suggested variable name: userPublicKey

The reason for this change is that the variable represents the public key of the user, and naming it userPublicKey would make the code more self-explanatory and easier to understand.

Here's the code snippet with the suggested change:

// Before change
var userHex, filename, contentType, path;
...
async function generateAuthorizationHeader(pubkey) {
  ...
  return `Nostr ${btoa(JSON.stringify(signedEvent))}`
}
...
console.log(`Logged in with public key: ${userHex}`)
...
const text = fileContent.value
var authorization = await generateAuthorizationHeader(userHex)
...

// After change
var userPublicKey, filename, contentType, path;
...
async function generateAuthorizationHeader(pubkey) {
  ...
  return `Nostr ${btoa(JSON.stringify(signedEvent))}`
}
...
console.log(`Logged in with public key: ${userPublicKey}`)
...
const text = fileContent.value
var authorization = await generateAuthorizationHeader(userPublicKey)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant