Skip to content

Commit

Permalink
chore: fix webview and app window freezing after successful login
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jul 6, 2024
1 parent 359b918 commit 2f46fa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ import 'package:timezone/data/latest.dart' as tz;
import 'package:window_manager/window_manager.dart';

Future<void> main(List<String> rawArgs) async {
if (rawArgs.contains("web_view_title_bar")) {
WidgetsFlutterBinding.ensureInitialized();
if (runWebViewTitleBarWidget(rawArgs)) {
return;
}
}
final arguments = await startCLI(rawArgs);
AppLogger.initialize(arguments["verbose"]);

AppLogger.runZoned(() async {
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();

if (runWebViewTitleBarWidget(rawArgs)) {
return;
}

await registerWindowsScheme("spotify");

tz.initializeTimeZones();
Expand Down
1 change: 1 addition & 0 deletions lib/pages/settings/sections/accounts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class SettingsAccountSection extends HookConsumerWidget {
"sp_dc=${cookies.firstWhere((element) => element.name.contains("sp_dc")).value.replaceAll("\u0000", "")}";

await authNotifier.login(cookieHeader);

webview.close();
if (context.mounted) {
context.go("/");
Expand Down

0 comments on commit 2f46fa3

Please sign in to comment.