mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Merge "Use localStorage for auto-save"
This commit is contained in:
commit
87d67d4a1c
|
@ -6,7 +6,7 @@ var
|
|||
lastControllerScrollOffset,
|
||||
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},
|
||||
createMemoryStorage = require( './createMemoryStorage.js' ),
|
||||
storage = createMemoryStorage( mw.storage.session ),
|
||||
storage = createMemoryStorage( mw.storage ),
|
||||
Parser = require( './Parser.js' ),
|
||||
ThreadItemSet = require( './ThreadItemSet.js' ),
|
||||
CommentDetails = require( './CommentDetails.js' ),
|
||||
|
|
|
@ -115,7 +115,7 @@ ReplyWidgetVisual.prototype.setup = function ( data, suppressNotifications ) {
|
|||
focus: [ 'emit', 'bodyFocus' ]
|
||||
} );
|
||||
|
||||
var listStorage = ve.init.platform.createListStorage( widget.storage );
|
||||
var listStorage = ve.init.platform.createConflictableStorage( widget.storage );
|
||||
// widget.storage is a MemoryStorage object. Copy over the .data cache so
|
||||
// that listStorage reads from/writes to the same in-memory cache.
|
||||
listStorage.data = widget.storage.data;
|
||||
|
@ -123,7 +123,8 @@ ReplyWidgetVisual.prototype.setup = function ( data, suppressNotifications ) {
|
|||
target.initAutosave( {
|
||||
suppressNotifications: suppressNotifications,
|
||||
docId: widget.storagePrefix,
|
||||
storage: listStorage
|
||||
storage: listStorage,
|
||||
storageExpiry: 60 * 60 * 24 * 30
|
||||
} );
|
||||
widget.afterSetup();
|
||||
|
||||
|
|
Loading…
Reference in a new issue