| 505 | } |
| 506 | |
| 507 | public undo(): Promise<void> { |
| 508 | this.logger.log('[SINGLE]', 'Undo', this.undoState); |
| 509 | if (!this.undoState) throw new SafeError('No undo state found'); |
| 510 | if (!this.undoState.onList) { |
| 511 | // @ts-ignore |
| 512 | if (typeof this.delete === 'undefined') throw new Error('Deleting an entry is not supported'); |
| 513 | // @ts-ignore |
| 514 | return this.delete().then(() => { |
| 515 | this.setStateEl(this.undoState); |
| 516 | this.undoState = null; |
| 517 | }); |
| 518 | } |
| 519 | this.setStateEl(this.undoState); |
| 520 | return this.sync().then(() => { |
| 521 | this.undoState = null; |
| 522 | }); |
| 523 | } |
| 524 | |
| 525 | abstract _getTitle(raw: boolean): string; |
| 526 | |