diff --git a/lib/main.dart b/lib/main.dart index 08c85271..349c1922 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,9 +111,19 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { @override - Widget build(BuildContext context) { + void initState() { + super.initState(); Provider.of(context, listen: false).loadUser(); + } + @override + void deactivate() async { + await Provider.of(context, listen: false).closeWS(); + super.deactivate(); + } + + @override + Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( diff --git a/lib/user.dart b/lib/user.dart index 32b88d53..87ce873b 100644 --- a/lib/user.dart +++ b/lib/user.dart @@ -112,7 +112,7 @@ class User with ChangeNotifier { 'Credentials': _user.credentials, 'Key': _user.credentialKey, 'Version': package.version, - 'OS': Platform.operatingSystem, + 'OS': getOperatingSystemName(), }; if (shouldUseFirebase) { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 2e016571..281ee20c 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -267,3 +267,10 @@ TextTheme getTextTheme() { textBaseline: TextBaseline.alphabetic, fontFamily: 'Inconsolata')); } + +String getOperatingSystemName() { + if (Globals.isIntegration) { + return '${Platform.operatingSystem}-integration'; + } + return Platform.operatingSystem; +}