-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
✨ feat(wakatime): new features and fixes #2434
Conversation
The `page` state will only ever be `undefined` on the first load. In that case, it uses the active `page` if available and uses `1` otherwise
BREAKING CHANGE: 💥️ The `useSummary` hook returns it's data in a `Types.RouteResponse` object now
extensions/wakatime/package.json
Outdated
"preferences": [ | ||
{ | ||
"name": "apiKey", | ||
"required": true, | ||
"required": false, | ||
"title": "WakaTime API Key", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I made this optional, I had to repeat it in the summary
and private-leaderboards
commands that require it.
I don't know if there's a better way of handling this, because I expected the apiKey
preference to be shared across all commands. But adding it to one command doesn't apply it to the others/entire extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately there's no current way of defining a per-extension required preference and make it not required for a particular command, so I guess this is the only way to go about it currently.
You can define a per-extension preference, the way you did here, make it required, and then re-define it in a particular command and set it to required: false
in that particular command. So your package.json would look like this:
…
"preferences": [
{
"name": "apiKey",
"required": true,
"title": "WakaTime API Key",
"type": "password",
"description": "Use your WakaTime API key to use your account",
"placeholder": "Enter your API key from https://wakatime.com/settings"
}
],
"commands": [
…
{
"name": "leaderboard",
"subtitle": "WakaTime",
"title": "Show Public Leaderboard",
"description": "An overview of the public leaderboard. Check your rank against others all around the world.",
"mode": "view",
"preferences": [
{
"name": "apiKey",
"description": "Use your WakaTime API key to use your account",
"type": "password",
"required": false,
"title": "WakaTime API Key"
}
]
},
…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works! My only problem is the user still has to provide the API key for that command as well. It's still better than the way I had it before, because now it's only one other command that asks for it.
Just to be sure, is there a way to set the preference programmatically? I checked but didn't find anything. @sxn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to set the preference programmatically?
Not yet, but it's been requested before, so we may end up looking into it.
the user still has to provide the API key for that command as well
do you mean the fact that the field still appears in preferences for that particular command? or something else?
The current version of the branch works as follows for me:
Screen.Recording.2022-10-27.at.13.21.55.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not my direct problem with it, but yeah I'll like for the same API key to be used across the extension and updating in the public leaderboard won't update the extension-wide one.
Its not a critical issue so can you please re-review the changes? Thanks!
a03eb1c
to
cad98c5
Compare
4c927c3
to
68b8e48
Compare
This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in the next 7 days to keep our backlog clean. Thanks for your contributions. |
🎉 |
Published to the Raycast Store: |
Description
apiKey
in some commands.NaN%
in activity change.Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are placed outside of themetadata
folder