-
Notifications
You must be signed in to change notification settings - Fork 54
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
Set bookmarks' default shortcut to an unused value, #200
Conversation
72ad6a6
to
d9060e6
Compare
bookmark_increment.mp4 |
Note: Doesn't handle cloning yet. Might be worth adding onCloned to the base node to allow for that. |
src_web/comfyui/bookmark.ts
Outdated
return usedShortcuts; | ||
} | ||
|
||
const SHORTCUT_DEFAULTS = `1234567890abcdefghijklmnopqrstuvwxyz`; |
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.
Use regular quotes and split this upfront in the const:
const SHORTCUT_DEFAULTS = "1234567890abcdefghijklmnopqrstuvwxyz".split("");
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.
Done :-)
src_web/comfyui/bookmark.ts
Outdated
|
||
function getNextShortcut() { | ||
const existingShortcuts = getExistingShortcuts(); | ||
for (const char of SHORTCUT_DEFAULTS.split('')) { |
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.
I think this can use find:
return SHORTCUT_DEFAULTS.find((char) => !existingShortcuts.has(char)) ?? '1';
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.
Done :-)
Nice! |
3cc7d9a
to
fdca8d7
Compare
61e6640
to
bcbd1c7
Compare
Rebased to include the other change. |
bcbd1c7
to
f25a161
Compare
f25a161
to
738441a
Compare
Updated with the recent changes. |
At least for the first 36...
Duplicates the
shortcutKey
getter in #198