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) {
192192 "const response = {" +
193193 " page_type: 'LANDING'" +
194194 "};" +
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) {" +
196198 " response.page_type = 'HOME';" +
197- "} if ($('form[id=\" vtopLoginForm\" ]').length === 1) {" +
199+ "} else if ($('form[id=\" vtopLoginForm\" ]').length === 1) {" +
198200 " response.page_type = 'LOGIN';" +
199201 "}" +
200202 "return response;" +
@@ -232,11 +234,13 @@ public void onPageFinished(WebView view, String url) {
232234 getSemesters ();
233235 pageState = PageState .HOME ;
234236 break ;
237+ case "BODY_NOT_READY" :
238+ break ;
235239 default :
236240 throw new Error ("Unknown page exception." );
237241 }
238242 } 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 ();
240244 }
241245 });
242246 }
You can’t perform that action at this time.
0 commit comments