fix splash

This commit is contained in:
Dan Ballard 2024-03-31 13:01:59 -07:00
parent ff297ff9e9
commit 8f2b0b8563
3 changed files with 11 additions and 7 deletions

View File

@ -58,6 +58,11 @@ class CwtchNotifier {
// EnvironmentConfig.debugLog("NewEvent $type $data");
switch (type) {
case "CwtchStarted":
flwtchState.cwtch.getCwtchDir().then((dir) {
globalSettings.themeloader.LoadThemes(dir);
});
if (data["Reload"] == "true" && profileCN.num > 0) {
// don't reload...
// unless we have loaded no profiles...then there isnt a risk and this

View File

@ -103,13 +103,10 @@ class FlwtchState extends State<Flwtch> with WindowListener {
new CwtchNotifier(profs, globalSettings, globalErrorHandler, globalTorStatus, newDesktopNotificationsManager(_notificationSelectConvo), globalAppState, globalServersList, this);
cwtch = CwtchFfi(cwtchNotifier);
}
print("initState: invoking cwtch.Start()");
// Cwtch.start can take time, we don't want it blocking first splash screen draw, so postpone a smidge to let splash render
cwtch.Start().then((vale) {
cwtch.getCwtchDir().then((dir) {
globalSettings.themeloader.LoadThemes(dir);
});
Future.delayed(const Duration(milliseconds: 100), () {
print("initState delayed: invoking cwtch.Start()");
cwtch.Start();
});
print("initState: starting connectivityListener");
if (EnvironmentConfig.TEST_MODE == false) {

View File

@ -7,6 +7,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../main.dart';
import '../settings.dart';
import '../themes/cwtch.dart';
class SplashView extends StatefulWidget {
@override
@ -26,6 +27,7 @@ class _SplashViewState extends State<SplashView> {
return Consumer<AppState>(
builder: (context, appState, child) => Scaffold(
backgroundColor: darkGreyPurple, // Cwtch Dark Background
key: Key("SplashView"),
body: Center(
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
@ -55,7 +57,7 @@ class _SplashViewState extends State<SplashView> {
? AppLocalizations.of(context)!.storageMigrationModalMessage
: AppLocalizations.of(context)!.shuttingDownApp, // Todo l10n AppLocalizations.of(context)!.storageMigrationModalMessage
style: defaultTextButtonStyle.copyWith(
fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor))),
fontSize: 16.0, fontFamily: "Inter", color: appState.appError == "" ? whiteishPurple : hotPink))),
Visibility(
visible: appState.modalState == ModalState.storageMigration || appState.modalState == ModalState.shutdown,
child: LinearProgressIndicator(