Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 4a3d785

Browse files
committed
Fix: Avoid calling notifyRunestoneComponents() twice if the jQuery.get fails.
1 parent a8c2cbf commit 4a3d785

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

runestone/common/js/bookfuncs.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,11 @@ pageProgressTracker = {};
169169

170170
function handlePageSetup() {
171171

172-
let data = {timezoneoffset: (new Date()).getTimezoneOffset()/60 }
173-
jQuery.get(eBookConfig.ajaxURL + 'set_tz_offset', data, function() {}).error(notifyRunestoneComponents);
172+
if (eBookConfig.useRunestoneServices) {
173+
jQuery.get(eBookConfig.ajaxURL + 'set_tz_offset', {
174+
timezoneoffset: (new Date()).getTimezoneOffset()/60
175+
});
176+
}
174177

175178
if (eBookConfig.isLoggedIn) {
176179
mess = `username: ${eBookConfig.username}`

0 commit comments

Comments
 (0)