diff options
author | 2023-05-27 18:48:38 +0530 | |
---|---|---|
committer | 2023-05-27 18:48:38 +0530 | |
commit | eaa8e80efadc55d42462af0a5381f2552acc3c88 (patch) | |
tree | b54868af925e2db3fc6d5444475cd14bd3255f1c /src/components/services/tabs | |
parent | update react version to 18.2.0 and it related changes (diff) | |
download | ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.tar.gz ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.tar.zst ferdium-app-eaa8e80efadc55d42462af0a5381f2552acc3c88.zip |
Expose "Clear service cache" in the service settings screen and the sidebar context menu for individual services (#1053)
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabBarSortableList.tsx | 3 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.tsx | 7 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.tsx | 3 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/components/services/tabs/TabBarSortableList.tsx b/src/components/services/tabs/TabBarSortableList.tsx index bb889ebef..5f711c30d 100644 --- a/src/components/services/tabs/TabBarSortableList.tsx +++ b/src/components/services/tabs/TabBarSortableList.tsx | |||
@@ -17,6 +17,7 @@ interface IProps { | |||
17 | toggleAudio: (args: { serviceId: string }) => void; | 17 | toggleAudio: (args: { serviceId: string }) => void; |
18 | toggleDarkMode: (args: { serviceId: string }) => void; | 18 | toggleDarkMode: (args: { serviceId: string }) => void; |
19 | deleteService: (args: { serviceId: string }) => void; | 19 | deleteService: (args: { serviceId: string }) => void; |
20 | clearCache: (args: { serviceId: string }) => void; | ||
20 | disableService: (args: { serviceId: string }) => void; | 21 | disableService: (args: { serviceId: string }) => void; |
21 | enableService: (args: { serviceId: string }) => void; | 22 | enableService: (args: { serviceId: string }) => void; |
22 | hibernateService: (args: { serviceId: string }) => void; | 23 | hibernateService: (args: { serviceId: string }) => void; |
@@ -34,6 +35,7 @@ class TabBarSortableList extends Component<IProps> { | |||
34 | toggleAudio, | 35 | toggleAudio, |
35 | toggleDarkMode, | 36 | toggleDarkMode, |
36 | deleteService, | 37 | deleteService, |
38 | clearCache, | ||
37 | disableService, | 39 | disableService, |
38 | enableService, | 40 | enableService, |
39 | hibernateService, | 41 | hibernateService, |
@@ -61,6 +63,7 @@ class TabBarSortableList extends Component<IProps> { | |||
61 | toggleAudio={() => toggleAudio({ serviceId: service.id })} | 63 | toggleAudio={() => toggleAudio({ serviceId: service.id })} |
62 | toggleDarkMode={() => toggleDarkMode({ serviceId: service.id })} | 64 | toggleDarkMode={() => toggleDarkMode({ serviceId: service.id })} |
63 | deleteService={() => deleteService({ serviceId: service.id })} | 65 | deleteService={() => deleteService({ serviceId: service.id })} |
66 | clearCache={() => clearCache({ serviceId: service.id })} | ||
64 | disableService={() => disableService({ serviceId: service.id })} | 67 | disableService={() => disableService({ serviceId: service.id })} |
65 | enableService={() => enableService({ serviceId: service.id })} | 68 | enableService={() => enableService({ serviceId: service.id })} |
66 | hibernateService={() => hibernateService({ serviceId: service.id })} | 69 | hibernateService={() => hibernateService({ serviceId: service.id })} |
diff --git a/src/components/services/tabs/TabItem.tsx b/src/components/services/tabs/TabItem.tsx index 2ed595919..289597db9 100644 --- a/src/components/services/tabs/TabItem.tsx +++ b/src/components/services/tabs/TabItem.tsx | |||
@@ -129,6 +129,7 @@ interface IProps extends WrappedComponentProps, WithStylesProps<typeof styles> { | |||
129 | toggleDarkMode: () => void; | 129 | toggleDarkMode: () => void; |
130 | openSettings: (args: { path: string }) => void; | 130 | openSettings: (args: { path: string }) => void; |
131 | deleteService: () => void; | 131 | deleteService: () => void; |
132 | clearCache: () => void; | ||
132 | disableService: () => void; | 133 | disableService: () => void; |
133 | enableService: () => void; | 134 | enableService: () => void; |
134 | hibernateService: () => void; | 135 | hibernateService: () => void; |
@@ -220,6 +221,7 @@ class TabItem extends Component<IProps, IState> { | |||
220 | toggleAudio, | 221 | toggleAudio, |
221 | toggleDarkMode, | 222 | toggleDarkMode, |
222 | deleteService, | 223 | deleteService, |
224 | clearCache, | ||
223 | disableService, | 225 | disableService, |
224 | enableService, | 226 | enableService, |
225 | hibernateService, | 227 | hibernateService, |
@@ -298,6 +300,11 @@ class TabItem extends Component<IProps, IState> { | |||
298 | enabled: service.isEnabled && service.canHibernate, | 300 | enabled: service.isEnabled && service.canHibernate, |
299 | }, | 301 | }, |
300 | { | 302 | { |
303 | label: intl.formatMessage(globalMessages.clearCache), | ||
304 | click: () => clearCache(), | ||
305 | enabled: service.isEnabled, | ||
306 | }, | ||
307 | { | ||
301 | type: 'separator', | 308 | type: 'separator', |
302 | }, | 309 | }, |
303 | { | 310 | { |
diff --git a/src/components/services/tabs/Tabbar.tsx b/src/components/services/tabs/Tabbar.tsx index e3b5a7ba9..f09877b2f 100644 --- a/src/components/services/tabs/Tabbar.tsx +++ b/src/components/services/tabs/Tabbar.tsx | |||
@@ -20,6 +20,7 @@ interface IProps { | |||
20 | toggleAudio: (args: { serviceId: string }) => void; | 20 | toggleAudio: (args: { serviceId: string }) => void; |
21 | toggleDarkMode: (args: { serviceId: string }) => void; | 21 | toggleDarkMode: (args: { serviceId: string }) => void; |
22 | deleteService: (args: { serviceId: string }) => void; | 22 | deleteService: (args: { serviceId: string }) => void; |
23 | clearCache: (args: { serviceId: string }) => void; | ||
23 | hibernateService: (args: { serviceId: string }) => void; | 24 | hibernateService: (args: { serviceId: string }) => void; |
24 | wakeUpService: (args: { serviceId: string }) => void; | 25 | wakeUpService: (args: { serviceId: string }) => void; |
25 | updateService: (args: { | 26 | updateService: (args: { |
@@ -86,6 +87,7 @@ class TabBar extends Component<IProps> { | |||
86 | toggleAudio, | 87 | toggleAudio, |
87 | toggleDarkMode, | 88 | toggleDarkMode, |
88 | deleteService, | 89 | deleteService, |
90 | clearCache, | ||
89 | useHorizontalStyle, | 91 | useHorizontalStyle, |
90 | showMessageBadgeWhenMutedSetting, | 92 | showMessageBadgeWhenMutedSetting, |
91 | showServiceNameSetting, | 93 | showServiceNameSetting, |
@@ -108,6 +110,7 @@ class TabBar extends Component<IProps> { | |||
108 | toggleAudio={toggleAudio} | 110 | toggleAudio={toggleAudio} |
109 | toggleDarkMode={toggleDarkMode} | 111 | toggleDarkMode={toggleDarkMode} |
110 | deleteService={deleteService} | 112 | deleteService={deleteService} |
113 | clearCache={clearCache} | ||
111 | disableService={args => this.disableService(args)} | 114 | disableService={args => this.disableService(args)} |
112 | enableService={args => this.enableService(args)} | 115 | enableService={args => this.enableService(args)} |
113 | hibernateService={args => this.hibernateService(args)} | 116 | hibernateService={args => this.hibernateService(args)} |