[PR #6596] Rename serverPrefs state slice property to server #6625

Closed
opened 2026-02-28 21:30:49 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6596

State: closed
Merged: Yes


Addresses feedback from #6234 to rename the serverPrefs property in the PrefsState to server for consistency with other preference properties (local, global, synced).

Changes

  • PrefsState type: serverPrefs: ServerPrefsserver: ServerPrefs
  • Reducers: Updated mergeServerPrefs, resetApp, and getUserData.fulfilled to reference state.server
  • useServerPref hook: Selector changed from state.prefs.serverPrefs[prefName] to state.prefs.server[prefName]
// Before
type PrefsState = {
  local: MetadataPrefs;
  global: GlobalPrefs;
  synced: SyncedPrefs;
  serverPrefs: ServerPrefs;  // ❌ Inconsistent naming
};

// After
type PrefsState = {
  local: MetadataPrefs;
  global: GlobalPrefs;
  synced: SyncedPrefs;
  server: ServerPrefs;  // ✅ Follows existing pattern
};

Backend API continues to use serverPrefs as the variable name when extracting from response payloads, maintaining compatibility with the server contract.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6596 **State:** closed **Merged:** Yes --- Addresses feedback from #6234 to rename the `serverPrefs` property in the PrefsState to `server` for consistency with other preference properties (`local`, `global`, `synced`). ## Changes - **PrefsState type**: `serverPrefs: ServerPrefs` → `server: ServerPrefs` - **Reducers**: Updated `mergeServerPrefs`, `resetApp`, and `getUserData.fulfilled` to reference `state.server` - **useServerPref hook**: Selector changed from `state.prefs.serverPrefs[prefName]` to `state.prefs.server[prefName]` ```typescript // Before type PrefsState = { local: MetadataPrefs; global: GlobalPrefs; synced: SyncedPrefs; serverPrefs: ServerPrefs; // ❌ Inconsistent naming }; // After type PrefsState = { local: MetadataPrefs; global: GlobalPrefs; synced: SyncedPrefs; server: ServerPrefs; // ✅ Follows existing pattern }; ``` Backend API continues to use `serverPrefs` as the variable name when extracting from response payloads, maintaining compatibility with the server contract. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
GiteaMirror added the pull-request label 2026-02-28 21:30:49 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#6625