refresh save
This commit is contained in:
@@ -379,27 +379,27 @@ export default {
|
||||
backStoreFunction() {
|
||||
let that = this;
|
||||
return function () {
|
||||
that.backStoreText(that);
|
||||
that.backStoreText();
|
||||
}
|
||||
},
|
||||
backStoreText(that) {
|
||||
let nowEditCount = that.noteForm.text.length;
|
||||
backStoreText() {
|
||||
let nowEditCount = this.noteForm.text.length;
|
||||
let nowEditTime = new Date().getTime();
|
||||
if (Math.abs(nowEditCount - that.lastStoreCount) > 10) {
|
||||
setStoreText(that.noteForm, that.state, that.secret);
|
||||
that.lastStoreTime = that.lastEditTime;
|
||||
that.lastStoreCount = nowEditCount;
|
||||
if (Math.abs(nowEditCount - this.lastStoreCount) > 10) {
|
||||
setStoreText(this.noteForm, this.state, this.secret);
|
||||
this.lastStoreTime = this.lastEditTime;
|
||||
this.lastStoreCount = nowEditCount;
|
||||
} else {
|
||||
if (nowEditTime - that.lastEditTime >= 1000 && nowEditTime - that.lastEditTime < 20000) {
|
||||
if (that.lastEditTime != that.lastStoreTime) {
|
||||
setStoreText(that.noteForm, that.state, that.secret);
|
||||
that.lastStoreTime = that.lastEditTime;
|
||||
that.lastStoreCount = nowEditCount;
|
||||
if (nowEditTime - this.lastEditTime >= 1000 && nowEditTime - this.lastEditTime < 20000) {
|
||||
if (this.lastEditTime != this.lastStoreTime) {
|
||||
setStoreText(this.noteForm, this.state, this.secret);
|
||||
this.lastStoreTime = this.lastEditTime;
|
||||
this.lastStoreCount = nowEditCount;
|
||||
}
|
||||
} else if (nowEditTime - that.lastEditTime >= 20000) {
|
||||
if (that.backStoreTextInterval != null) {
|
||||
let ivl = that.backStoreTextInterval;
|
||||
that.backStoreTextInterval = null;
|
||||
} else if (nowEditTime - this.lastEditTime >= 20000) {
|
||||
if (this.backStoreTextInterval != null) {
|
||||
let ivl = this.backStoreTextInterval;
|
||||
this.backStoreTextInterval = null;
|
||||
window.clearInterval(ivl);
|
||||
}
|
||||
}
|
||||
@@ -602,7 +602,7 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeunloadHandler() {
|
||||
this.recordText();
|
||||
setStoreText(this.noteForm, this.state, this.secret);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user