MCPcopy Index your code
hub / github.com/MALSync/MALSync / undo

Function undo

src/_provider/singleAbstract.ts:507–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

deleteMethod · 0.80
syncMethod · 0.80

Tested by

no test coverage detected