Fix getting stuck on splash screen when veilid is already started

This commit is contained in:
Brandon Vandegrift 2025-04-03 13:51:14 -04:00
parent f4407e5284
commit 746e5ccc64

View File

@ -44,8 +44,21 @@ class ProcessorRepository {
log.info('Veilid version: $veilidVersion');
final updateStream = await Veilid.instance
.startupVeilidCore(await getVeilidConfig(kIsWeb, VeilidChatApp.name));
Stream<VeilidUpdate> updateStream;
try {
log.debug('Starting VeilidCore');
updateStream = await Veilid.instance
.startupVeilidCore(await getVeilidConfig(kIsWeb, VeilidChatApp.name));
} on VeilidAPIExceptionAlreadyInitialized catch (_) {
log.debug(
'VeilidCore is already started, shutting down and restarting...');
startedUp = true;
await shutdown();
updateStream = await Veilid.instance
.startupVeilidCore(await getVeilidConfig(kIsWeb, VeilidChatApp.name));
}
_updateSubscription = updateStream.listen((update) {
if (update is VeilidLog) {
processLog(update);