Skip to content

Commit

Permalink
Merge pull request #553 from TaYaKi71751/dev-fix-login
Browse files Browse the repository at this point in the history
Try jsonDecode in try/catch
  • Loading branch information
violet-dev authored Oct 5, 2024
2 parents 5528211 + 621af52 commit 01ef6ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions violet/lib/pages/settings/login/ehentai_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ class _LoginScreenState extends State<LoginScreen> {

Future<void> _checkCookie() async {
final controller = await _webViewController.future;
final cookieString = jsonDecode(
await controller.runJavascriptReturningResult('document.cookie'))
as String;
var cookieString =
await controller.runJavascriptReturningResult('document.cookie');
try {
cookieString = jsonDecode(cookieString) as String;
} catch (e) {}
final cookies = parseCookies(cookieString);
developer.log('Get cookies: $cookies');

Expand Down

0 comments on commit 01ef6ce

Please sign in to comment.