Do not look for restore data until we have saved the current form's data, otherwise we wipe out the data that might have been there on the first show of that URL.

This commit is contained in:
jrburke 2011-05-03 16:27:00 -07:00
Родитель b2bb779f6e
Коммит 7bf8989112
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -338,15 +338,19 @@ function (object, Widget, $, template,
var root = $(this.node),
opts = this.options,
formLink = jigFuncs.link(opts),
restoredData = this.memStore[formLink],
oldData;
oldData = this.getFormData(),
restoredData;
//Save off previous form data for old URL.
oldData = this.getFormData();
if (oldData.to || oldData.message || oldData.subject) {
this.memStore[oldData.link] = oldData;
}
//Get any data to restore. Do this after saving the oldData
//since it could be that we are on the same URL and it is the first
//refresh to this URL.
restoredData = this.memStore[formLink];
//Delete memory data for current URL if the account changed.
if (restoredData && this.theGameHasChanged(restoredData)) {
restoredData = null;