File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
app/src/main/java/tk/therealsuji/vtopchennai/services Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -192,9 +192,11 @@ public void onPageFinished(WebView view, String url) {
192
192
"const response = {" +
193
193
" page_type: 'LANDING'" +
194
194
"};" +
195
- "if ($('input[id=\" authorizedIDX\" ]').length === 1) {" +
195
+ "if (document.body === null) {" +
196
+ " response.page_type = 'BODY_NOT_READY';" +
197
+ "} else if ($('input[id=\" authorizedIDX\" ]').length === 1) {" +
196
198
" response.page_type = 'HOME';" +
197
- "} if ($('form[id=\" vtopLoginForm\" ]').length === 1) {" +
199
+ "} else if ($('form[id=\" vtopLoginForm\" ]').length === 1) {" +
198
200
" response.page_type = 'LOGIN';" +
199
201
"}" +
200
202
"return response;" +
@@ -232,11 +234,13 @@ public void onPageFinished(WebView view, String url) {
232
234
getSemesters ();
233
235
pageState = PageState .HOME ;
234
236
break ;
237
+ case "BODY_NOT_READY" :
238
+ break ;
235
239
default :
236
240
throw new Error ("Unknown page exception." );
237
241
}
238
242
} catch (JSONException e ) {
239
- Toast .makeText (VTOPService .this , "Error:" + e .getLocalizedMessage (), Toast .LENGTH_SHORT ).show ();
243
+ Toast .makeText (VTOPService .this , "Error: " + e .getLocalizedMessage (), Toast .LENGTH_SHORT ).show ();
240
244
}
241
245
});
242
246
}
You can’t perform that action at this time.
0 commit comments