(fileEditor?: string)
| 274 | } |
| 275 | |
| 276 | onSaveToFile(fileEditor?: string) { |
| 277 | try { |
| 278 | const fileLang = this.currentLanguage?.name ?? ''; |
| 279 | const name = fileLang && fileEditor !== undefined ? fileLang + ' Editor #' + fileEditor + ' ' : ''; |
| 280 | saveAs( |
| 281 | new Blob([this.editorText], {type: 'text/plain;charset=utf-8'}), |
| 282 | 'Compiler Explorer ' + name + 'Code' + this.extension, |
| 283 | ); |
| 284 | return true; |
| 285 | } catch { |
| 286 | this.alertSystem.notify('Error while saving your code. Use the clipboard instead.', { |
| 287 | group: 'savelocalerror', |
| 288 | alertClass: 'notification-error', |
| 289 | dismissTime: 5000, |
| 290 | }); |
| 291 | return false; |
| 292 | } |
| 293 | } |
| 294 | } |
no test coverage detected