mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 18:24:11 +00:00
feat: add setMany to settingStore for batch setting updates (#8767)
## Summary - Adds `setMany()` method to `settingStore` for updating multiple settings in a single API call via the existing `storeSettings` endpoint - Extracts shared setting-apply logic (`applySettingLocally`) to reduce duplication between `set()` and `setMany()` - Migrates all call sites where multiple settings were updated sequentially to use `setMany()` ## Call sites updated - `releaseStore.ts` — `handleSkipRelease`, `handleShowChangelog`, `handleWhatsNewSeen` (3 settings each) - `keybindingService.ts` — `persistUserKeybindings` (2 settings) - `coreSettings.ts` — `NavigationMode.onChange` (2 settings) ## Test plan - [x] Unit tests for `setMany` (batch update, skip unchanged, no-op when unchanged) - [x] Updated `releaseStore.test.ts` assertions to verify `setMany` usage - [x] Updated `useCoreCommands.test.ts` mock to include `setMany` - [x] All existing tests pass - [x] `pnpm typecheck`, `pnpm lint`, `pnpm format` pass Fixes #1079 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8767-feat-add-setMany-to-settingStore-for-batch-setting-updates-3036d73d36508161b8b6d298e1be1b7a) by [Unito](https://www.unito.io)
This commit is contained in:
committed by
GitHub
parent
061e96e488
commit
0288ea5b39
@@ -137,14 +137,14 @@ export function useKeybindingService() {
|
||||
}
|
||||
|
||||
async function persistUserKeybindings() {
|
||||
await settingStore.set(
|
||||
'Comfy.Keybinding.NewBindings',
|
||||
Object.values(keybindingStore.getUserKeybindings())
|
||||
)
|
||||
await settingStore.set(
|
||||
'Comfy.Keybinding.UnsetBindings',
|
||||
Object.values(keybindingStore.getUserUnsetKeybindings())
|
||||
)
|
||||
await settingStore.setMany({
|
||||
'Comfy.Keybinding.NewBindings': Object.values(
|
||||
keybindingStore.getUserKeybindings()
|
||||
),
|
||||
'Comfy.Keybinding.UnsetBindings': Object.values(
|
||||
keybindingStore.getUserUnsetKeybindings()
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user