MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / loadConfig

Method loadConfig

src/main/core/superPanelManager.ts:70–88  ·  view source on GitHub ↗

* 从数据库加载配置并启动监听

()

Source from the content-addressed store, hash-verified

68 * 从数据库加载配置并启动监听
69 */
70 private loadConfig(): void {
71 try {
72 const data = databaseAPI.dbGet('settings-general')
73 if (data) {
74 this.config = {
75 enabled: data.superPanelEnabled ?? false,
76 mouseButton: data.superPanelMouseButton ?? 'middle',
77 longPressMs: data.superPanelLongPressMs ?? 500,
78 blockedApps: data.superPanelBlockedApps ?? []
79 }
80 if (this.config.enabled) {
81 this.startMonitor()
82 }
83 console.log('[SuperPanel] 超级面板配置已加载:', this.config)
84 }
85 } catch (error) {
86 console.error('[SuperPanel] 加载超级面板配置失败:', error)
87 }
88 }
89
90 /**
91 * 设置变更时调用(从设置页面触发)

Callers 1

initMethod · 0.95

Calls 2

startMonitorMethod · 0.95
dbGetMethod · 0.45

Tested by

no test coverage detected