Replace a couple more nsITimer calls
This commit is contained in:
parent
b916935256
commit
14bb52a43f
1 changed files with 6 additions and 8 deletions
|
@ -610,10 +610,9 @@ Zotero.Attachments = new function(){
|
|||
// we'll index it later if it fails
|
||||
//
|
||||
// TODO: index later
|
||||
var timer = Components.classes["@mozilla.org/timer;1"].
|
||||
createInstance(Components.interfaces.nsITimer);
|
||||
timer.initWithCallback({notify: f}, 1000,
|
||||
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
|
||||
setTimeout(function () {
|
||||
f();
|
||||
}, 1000);
|
||||
}
|
||||
catch (e) {
|
||||
// Clean up
|
||||
|
@ -650,10 +649,9 @@ Zotero.Attachments = new function(){
|
|||
Zotero.Notifier.trigger('add', 'item', itemID);
|
||||
|
||||
// Wait a second before indexing (see note above)
|
||||
var timer = Components.classes["@mozilla.org/timer;1"].
|
||||
createInstance(Components.interfaces.nsITimer);
|
||||
timer.initWithCallback({notify: f}, 1000,
|
||||
Components.interfaces.nsITimer.TYPE_ONE_SHOT);
|
||||
setTimeout(function () {
|
||||
f();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// Caution: Take care using this itemID. The notifier may not yet have been called,
|
||||
|
|
Loading…
Reference in a new issue