* Opens a script by setting its order property * @param {string} appId - The application ID * @param {number} scriptId - The script ID to open * @param {number} order - The order position for the tab * @returns {Promise}
(appId, scriptId, order)
| 111 | * @returns {Promise} |
| 112 | */ |
| 113 | async openScript(appId, scriptId, order) { |
| 114 | const allScripts = await this.getScripts(appId); |
| 115 | const updatedScripts = allScripts.map(script => |
| 116 | script.id === scriptId |
| 117 | ? { ...script, order } |
| 118 | : script |
| 119 | ); |
| 120 | await this.saveScripts(appId, updatedScripts); |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Closes a script by removing its order property |
no test coverage detected