Let's say post #2 quotes post number #1. If a user decides to quote the quote in post #2, it should keep the information of post #1 ("user_1, post: 1, topic: X"), instead of replacing with current post info ("user_2, post: 2, topic: X").
18 lines
275 B
JavaScript
18 lines
275 B
JavaScript
export default class QuoteState {
|
|
constructor() {
|
|
this.clear();
|
|
}
|
|
|
|
selected(postId, buffer, opts) {
|
|
this.postId = postId;
|
|
this.buffer = buffer;
|
|
this.opts = opts;
|
|
}
|
|
|
|
clear() {
|
|
this.buffer = "";
|
|
this.postId = null;
|
|
this.opts = null;
|
|
}
|
|
}
|