Repository navigation
Meta: Prepare support for multiple tokens - #10121
Merged
Merged
Conversation
fregante
commented
Sep 24, 2026
| export async function getToken(): Promise<string | undefined> { | ||
| const {personalToken} = await cachedSettings; | ||
| return personalToken; | ||
| return personalToken[0]; |
Member
Author
There was a problem hiding this comment.
User-picking logic to be implemented separately
Comment on lines
+70
to
+74
| <TokenInput {host} /> | ||
| <TokenInput {host} /> | ||
| <TokenInput {host} /> | ||
| <TokenInput {host} /> | ||
| <TokenInput {host} /> |
Member
Author
There was a problem hiding this comment.
To avoid a chicken and egg problem in webext-options-sync's syncForm method, I just create a pre-set maximum number of fields and just hide them visually as required.
| for (const tokenField of $$('input[name="personalToken"]')) { | ||
| informComponentOfExternalUpdate(tokenField); | ||
| for (const tokenField of $$('input[name="personalToken[]"]')) { | ||
| informComponentOfExternalUpdate(tokenField as HTMLInputElement); |
Member
Author
There was a problem hiding this comment.
|
|
||
| // @ts-expect-error TS and its index signatures... | ||
| optionsStorage.set({personalToken: tokenInput}); | ||
| optionsStorage.set({personalToken: [tokenInput]}); |
Member
Author
There was a problem hiding this comment.
I need to decide what to do when the user clicks "Open welcome page" in the options and enters a token here. Currently this discards everything else.
Lowest-effort: check for multiple tokens, open alert() on load
Member
Author
fregante
marked this pull request as ready for review
September 26, 2026 09:34
fregante
enabled auto-merge (squash)
September 26, 2026 10:00
fregante
disabled auto-merge
September 26, 2026 10:00
fregante
enabled auto-merge (squash)
September 26, 2026 10:01
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

input[name="personalToken[]"]g-plane/typed-query-selector#48This PR only ensures that all dependencies support this setup and it makes it viable to implement multiple user support without leaky hacks like #9966