Fix sync icon error handling (trunk and SP2 tag)

This commit is contained in:
Dan Stillman 2008-09-01 08:09:37 +00:00
parent 9c3c7ebbb7
commit 4d9e018ca5
2 changed files with 4 additions and 4 deletions

View File

@ -342,7 +342,7 @@
<toolbarbutton id="zotero-tb-sync" tooltip="_child"
oncommand="Zotero.Sync.Runner.sync()">
<tooltip
onpopupshowing="if (Zotero.Sync.Server.lastSyncError) { this.firstChild.nextSibling.value = 'Last error: ' + Zotero.Sync.Server.lastSyncError; return; } this.firstChild.nextSibling.value = 'Last sync: ' + (Zotero.Sync.Server.lastLocalSyncTime ? new Date(Zotero.Sync.Server.lastLocalSyncTime * 1000).toLocaleString() : 'Not yet synced')"
onpopupshowing="if (Zotero.Sync.Runner.lastSyncError) { this.firstChild.nextSibling.value = 'Last error: ' + Zotero.Sync.Runner.lastSyncError; return; } this.firstChild.nextSibling.value = 'Last sync: ' + (Zotero.Sync.Server.lastLocalSyncTime ? new Date(Zotero.Sync.Server.lastLocalSyncTime * 1000).toLocaleString() : 'Not yet synced')"
noautohide="true"><!-- TODO: localize -->
<label value="Sync with Zotero Server"/>
<label id="zotero-last-sync-time"/>

View File

@ -1964,13 +1964,13 @@ Zotero.Sync.Storage = new function () {
_syncInProgress = false;
Zotero.DB.rollbackAllTransactions();
Zotero.Sync.Server.setSyncIcon('error');
Zotero.Sync.Runner.setSyncIcon('error');
if (e.name) {
Zotero.Sync.Server.lastSyncError = e.name;
Zotero.Sync.Runner.lastSyncError = e.name;
}
else {
Zotero.Sync.Server.lastSyncError = e;
Zotero.Sync.Runner.lastSyncError = e;
}
Zotero.debug(e, 1);
Zotero.Sync.Runner.reset();