rte: remove logging and fix new history
This commit is contained in:
parent
6004f6d610
commit
8dc7f8efe2
3 changed files with 8 additions and 6 deletions
|
@ -44,14 +44,20 @@ export default class ComposerHistoryManager {
|
|||
|
||||
// TODO: Performance issues?
|
||||
for(; sessionStorage.getItem(`${this.prefix}[${this.lastIndex}]`); this.lastIndex++, this.currentIndex++) {
|
||||
history.push(JSON.parse(sessionStorage.getItem(`${this.prefix}[${this.lastIndex}]`)));
|
||||
this.history.push(
|
||||
Object.assign(
|
||||
new HistoryItem(),
|
||||
JSON.parse(sessionStorage.getItem(`${this.prefix}[${this.lastIndex}]`)),
|
||||
),
|
||||
);
|
||||
}
|
||||
this.currentIndex--;
|
||||
}
|
||||
|
||||
addItem(message: string, format: MessageFormat) {
|
||||
const item = new HistoryItem(message, format);
|
||||
this.history.push(item);
|
||||
this.currentIndex = this.lastIndex;
|
||||
this.currentIndex = this.lastIndex + 1;
|
||||
sessionStorage.setItem(`${this.prefix}[${this.lastIndex++}]`, JSON.stringify(item));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue