Skip to content

A full-featured download manager.

chore: js code format

Dr_rOote3e2abac6fcc
diff --git a/src/main/ui/TouchBarManager.js b/src/main/ui/TouchBarManager.js
index 0c1090a6..f685392b 100644
--- a/src/main/ui/TouchBarManager.js
+++ b/src/main/ui/TouchBarManager.js
@@ -42,32 +42,32 @@ export default class TouchBarManager extends EventEmitter {
const { label, backgroundColor, textColor, size } = options
switch (type) {
- case 'button':
- result = new TouchBarButton({
- label,
- backgroundColor,
- icon: this.getIconImage(options.icon),
- click: this.getClickFn(options)
+ case 'button':
+ result = new TouchBarButton({
+ label,
+ backgroundColor,
+ icon: this.getIconImage(options.icon),
+ click: this.getClickFn(options)
+ })
+ break
+ case 'label':
+ result = new TouchBarLabel({
+ label,
+ textColor
+ })
+ break
+ case 'spacer':
+ result = new TouchBarSpacer({ size })
+ break
+ case 'group':
+ result = new TouchBarGroup({
+ items: new TouchBar({
+ items: options.items
})
- break
- case 'label':
- result = new TouchBarLabel({
- label,
- textColor
- })
- break
- case 'spacer':
- result = new TouchBarSpacer({ size })
- break
- case 'group':
- result = new TouchBarGroup({
- items: new TouchBar({
- items: options.items
- })
- })
- break
- default:
- result = null
+ })
+ break
+ default:
+ result = null
}
return result
diff --git a/src/main/utils/menu.js b/src/main/utils/menu.js
index 523e4e5f..8f6b0038 100644
--- a/src/main/utils/menu.js
+++ b/src/main/utils/menu.js
@@ -3,31 +3,31 @@ export function concat (template, submenu, submenuToAdd) {
let relativeItem = null
if (sub.position) {
switch (sub.position) {
- case 'first':
- submenu.unshift(sub)
- break
- case 'last':
- submenu.push(sub)
- break
- case 'before':
- relativeItem = findById(template, sub['relative-id'])
- if (relativeItem) {
- const array = relativeItem.__parent
- const index = array.indexOf(relativeItem)
- array.splice(index, 0, sub)
- }
- break
- case 'after':
- relativeItem = findById(template, sub['relative-id'])
- if (relativeItem) {
- const array = relativeItem.__parent
- const index = array.indexOf(relativeItem)
- array.splice(index + 1, 0, sub)
- }
- break
- default:
- submenu.push(sub)
- break
+ case 'first':
+ submenu.unshift(sub)
+ break
+ case 'last':
+ submenu.push(sub)
+ break
+ case 'before':
+ relativeItem = findById(template, sub['relative-id'])
+ if (relativeItem) {
+ const array = relativeItem.__parent
+ const index = array.indexOf(relativeItem)
+ array.splice(index, 0, sub)
+ }
+ break
+ case 'after':
+ relativeItem = findById(template, sub['relative-id'])
+ if (relativeItem) {
+ const array = relativeItem.__parent
+ const index = array.indexOf(relativeItem)
+ array.splice(index + 1, 0, sub)
+ }
+ break
+ default:
+ submenu.push(sub)
+ break
}
} else {
submenu.push(sub)
diff --git a/src/renderer/api/Api.js b/src/renderer/api/Api.js
index 40223aa1..424ef0f6 100644
--- a/src/renderer/api/Api.js
+++ b/src/renderer/api/Api.js
@@ -244,14 +244,14 @@ export default class Api {
fetchTaskList (params = {}) {
const { type } = params
switch (type) {
- case 'active':
- return this.fetchDownloadingTaskList(params)
- case 'waiting':
- return this.fetchWaitingTaskList(params)
- case 'stopped':
- return this.fetchStoppedTaskList(params)
- default:
- return this.fetchDownloadingTaskList(params)
+ case 'active':
+ return this.fetchDownloadingTaskList(params)
+ case 'waiting':
+ return this.fetchWaitingTaskList(params)
+ case 'stopped':
+ return this.fetchStoppedTaskList(params)
+ default:
+ return this.fetchDownloadingTaskList(params)
}
}
diff --git a/src/shared/locales/all.js b/src/shared/locales/all.js
index bf614f33..c23b7bce 100644
--- a/src/shared/locales/all.js
+++ b/src/shared/locales/all.js
@@ -28,6 +28,7 @@ import appLocaleZhTW from '@shared/locales/zh-TW'
import appLocaleUk from '@shared/locales/uk'
// Please keep the locale key in alphabetical order.
+/* eslint-disable quote-props */
const resources = {
'ca': {
translation: {
@@ -114,5 +115,6 @@ const resources = {
}
}
}
+/* eslint-enable quote-props */
export default resources
diff --git a/src/shared/locales/app.js b/src/shared/locales/app.js
index cb4fd7f0..2e41a134 100644
--- a/src/shared/locales/app.js
+++ b/src/shared/locales/app.js
@@ -13,6 +13,7 @@ import appLocaleZhTW from '@shared/locales/zh-TW'
import appLocaleUk from '@shared/locales/uk'
// Please keep the locale key in alphabetical order.
+/* eslint-disable quote-props */
const resources = {
'ca': {
translation: {
@@ -80,5 +81,6 @@ const resources = {
}
}
}
+/* eslint-enable quote-props */
export default resources