@@ -99,13 +99,13 @@ function addReadingList() {
9999 name : "link" ,
100100 class : "btn btn-lg ' + 'buttonConfirmCompletion'" ,
101101 href : nxt_link ,
102- text : `Continue to page ${ position + 2
103- } of ${ num_readings } in the reading assignment.`,
102+ text : `Continue to page ${
103+ position + 2
104+ } of ${ num_readings } in the reading assignment.`,
104105 } ) ;
105106 } else {
106107 l = $ ( "<div />" , {
107- text :
108- "This page is not part of the last reading assignment you visited." ,
108+ text : "This page is not part of the last reading assignment you visited." ,
109109 } ) ;
110110 }
111111 $ ( "#main-content" ) . append ( l ) ;
@@ -195,7 +195,7 @@ class PageProgressBar {
195195 if (
196196 val == 100.0 &&
197197 $ ( "#completionButton" ) . text ( ) . toLowerCase ( ) ===
198- "mark as completed"
198+ "mark as completed"
199199 ) {
200200 $ ( "#completionButton" ) . click ( ) ;
201201 }
@@ -211,23 +211,20 @@ async function handlePageSetup() {
211211 "Content-type" : "application/json; charset=utf-8" ,
212212 Accept : "application/json" ,
213213 } ) ;
214- let data = { timezoneoffset : new Date ( ) . getTimezoneOffset ( ) / 60 }
215- let request = new Request (
216- "/logger/set_tz_offset" ,
217- {
218- method : "POST" ,
219- body : JSON . stringify ( data ) ,
220- headers : headers ,
221- }
222- ) ;
214+ let data = { timezoneoffset : new Date ( ) . getTimezoneOffset ( ) / 60 } ;
215+ let request = new Request ( "/logger/set_tz_offset" , {
216+ method : "POST" ,
217+ body : JSON . stringify ( data ) ,
218+ headers : headers ,
219+ } ) ;
223220 try {
224221 let response = await fetch ( request ) ;
225- if ( response . status != 200 ) {
226- console . log ( `Failed to set timezone! ${ response . statusText } ` )
222+ if ( ! response . ok ) {
223+ console . error ( `Failed to set timezone! ${ response . statusText } ` ) ;
227224 }
228225 data = await response . json ( ) ;
229226 } catch ( e ) {
230-
227+ console . error ( `Error setting timezone ${ e } ` ) ;
231228 }
232229
233230 if ( eBookConfig . isLoggedIn ) {
0 commit comments