MCPcopy
hub / github.com/agalwood/Motrix / watchRunModeChange

Method watchRunModeChange

src/main/Application.js:273–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271 }
272
273 watchRunModeChange () {
274 const { userConfig } = this.configManager
275 const key = 'run-mode'
276 this.configListeners[key] = userConfig.onDidChange(key, async (newValue, oldValue) => {
277 logger.info(`[Motrix] detected ${key} value change event:`, newValue, oldValue)
278 this.trayManager.handleRunModeChange(newValue)
279
280 if (newValue !== APP_RUN_MODE.TRAY) {
281 this.dockManager.show()
282 } else {
283 this.dockManager.hide()
284 // Hiding the dock icon will trigger the entire app to hide.
285 this.show()
286 }
287 })
288 }
289
290 watchShowProgressBarChange () {
291 const { userConfig } = this.configManager

Callers 1

handleEventsMethod · 0.95

Calls 3

showMethod · 0.95
handleRunModeChangeMethod · 0.80
hideMethod · 0.80

Tested by

no test coverage detected