Add method to get stored JSON history from outside coreHistory object (re: b4ef0862978ae79a5cb741ac49370ed678857b1f)

This commit is contained in:
Quincy Morgan
2020-01-15 13:08:32 -05:00
parent 186aec68ac
commit ab278a84df

View File

@@ -676,6 +676,11 @@ export function coreHistory(context) {
},
savedHistoryJSON: function() {
return context.storage(getKey('saved_history'));
},
hasRestorableChanges: function() {
return _hasUnresolvedRestorableChanges;
},
@@ -685,7 +690,7 @@ export function coreHistory(context) {
restore: function() {
if (lock.locked()) {
_hasUnresolvedRestorableChanges = false;
var json = context.storage(getKey('saved_history'));
var json = this.savedHistoryJSON();
if (json) history.fromJSON(json, true);
}
},