Files
standardnotes-app-web/app/assets/javascripts/models/noteHistoryEntry.js
2020-02-04 14:20:20 +01:00

21 lines
578 B
JavaScript

import { SFItemHistoryEntry } from 'snjs';
export class NoteHistoryEntry extends SFItemHistoryEntry {
previewTitle() {
return this.item.updated_at.toLocaleString();
}
previewSubTitle() {
if(!this.hasPreviousEntry) {
return `${this.textCharDiffLength} characters loaded`;
} else if(this.textCharDiffLength < 0) {
return `${this.textCharDiffLength * -1} characters removed`;
} else if(this.textCharDiffLength > 0) {
return `${this.textCharDiffLength} characters added`;
} else {
return "Title or metadata changed";
}
}
}