feat(preferences): add getAll method and IPC handler for retrieving all preferences
This commit introduces a new IPC channel and handler for fetching all user preferences at once, enhancing the efficiency of preference management. The PreferenceService is updated with a getAll method to retrieve all preferences from the memory cache, and the renderer-side PreferenceService is adjusted to support this new functionality. Additionally, type safety improvements are made across the preference handling code, ensuring better consistency and reducing potential errors.
This commit is contained in:
@@ -273,6 +273,19 @@ export class PreferenceService {
|
||||
setInterval(cleanup, 30000)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all preferences from memory cache
|
||||
* Returns complete preference object for bulk operations
|
||||
*/
|
||||
getAll(): PreferenceDefaultScopeType {
|
||||
if (!this.initialized) {
|
||||
logger.warn('Preference cache not initialized, returning defaults')
|
||||
return DefaultPreferences.default
|
||||
}
|
||||
|
||||
return { ...this.cache }
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all current subscriptions (for debugging)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user