Skip to content

🔨 Refactor(db): rm config store#1371

Merged
Molunerfinn merged 2 commits intodevfrom
feature-db-refactor
Jan 7, 2026
Merged

🔨 Refactor(db): rm config store#1371
Molunerfinn merged 2 commits intodevfrom
feature-db-refactor

Conversation

@Molunerfinn
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the codebase by removing the custom ConfigStore (db) wrapper and migrating to using the PicGo core library's native configuration methods directly. This simplifies the configuration management layer and reduces code duplication.

  • Replaced all db.get() calls with picgo.getConfig<T>() with proper type annotations
  • Replaced all db.set() calls with picgo.saveConfig() using object notation
  • Removed the ConfigStore class entirely from datastore/index.ts, keeping only the GalleryDB class

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/utils/updateChecker.ts Migrated from db methods to picgo.getConfig/saveConfig for update tip settings
src/main/utils/privacyManager.ts Updated privacy check to use picgo.getConfig for privacy ensure flag
src/main/utils/handleI18n.ts Changed language initialization to use picgo.getConfig for language settings
src/main/utils/dataReport.ts Updated data reporting to retrieve picBed configuration via picgo.getConfig
src/main/utils/common.ts Migrated URL copy and encoding functions to use picgo.getConfig; contains unintended clipboard.writeText addition
src/main/migrate/index.ts Refactored migration functions to work directly with picgo instance instead of db
src/main/lifeCycle/index.ts Updated lifecycle hooks to use picgo.saveConfig and removed db import
src/main/events/rpc/routes/toolbox/checkFile.ts Changed to use getGalleryDBPath() function instead of exported constant
src/main/events/ipcList.ts Migrated IPC handlers to use picgo.getConfig for paste style and custom link settings
src/main/apis/gui/index.ts Updated GUI API to use picgo.getConfig for paste template configuration
src/main/apis/core/picgo/index.ts Commented out debounced DB flush logic (no longer needed with direct picgo usage)
src/main/apis/core/datastore/index.ts Removed entire ConfigStore class, keeping only GalleryDB implementation
src/main/apis/app/window/windowList.ts Updated window configuration to use picgo.getConfig for startup and display settings
src/main/apis/app/uploader/index.ts Migrated uploader configuration reads to use picgo.getConfig
src/main/apis/app/uploader/apis.ts Changed upload APIs to retrieve settings via picgo.getConfig
src/main/apis/app/system/index.ts Updated system tray and context menu to use picgo.getConfig/saveConfig
src/main/apis/app/shortKey/shortKeyHandler.ts Refactored shortkey management to use picgo methods; uses potentially unavailable removeConfig method
package.json Added check script and integrated lint:dpdm into main lint command
AGENTS.md Updated documentation to mention new check command
.gitignore Added .cache/ directory to ignored files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Molunerfinn Molunerfinn merged commit 50881b0 into dev Jan 7, 2026
@Molunerfinn Molunerfinn deleted the feature-db-refactor branch January 7, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants