()
| 243 | |
| 244 | // Create the switch button. |
| 245 | #updateSwitchButton() { |
| 246 | for (const switcher of this.switchers) { |
| 247 | this.toolbar.removeChildView(switcher.view); |
| 248 | switcher.destructor(); |
| 249 | } |
| 250 | this.switchers = []; |
| 251 | const serviceRecord = serviceManager.getRegisteredServices().find(record => this.service.constructor == record.serviceClass); |
| 252 | if (serviceRecord?.params) { |
| 253 | for (const param of serviceRecord.params) { |
| 254 | if (param.hasSwitcher) { |
| 255 | const switcher = new SwitcherButton(this.service, param, false); |
| 256 | this.toolbar.addChildView(switcher.view); |
| 257 | this.switchers.push(switcher); |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | const apiRecord = apiManager.getAPIRecord(this.service.api.credential.type); |
| 262 | if (apiRecord?.params) { |
| 263 | for (const param of apiRecord.params) { |
| 264 | if (param.hasSwitcher) { |
| 265 | const switcher = new SwitcherButton(this.service, param, true); |
| 266 | this.toolbar.addChildView(switcher.view); |
| 267 | this.switchers.push(switcher); |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | // Set the input and button to ready to send state. |
| 274 | #resetUIState() { |
no test coverage detected