mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-20 05:09:51 -04:00
Merge branch 'feature/fix-veilidcore-already-started' into 'main'
Fix getting stuck on splash screen when VeilidCore is already started See merge request veilid/veilidchat!42
This commit is contained in:
commit
a5777ae628
1 changed files with 15 additions and 2 deletions
|
@ -44,8 +44,21 @@ class ProcessorRepository {
|
||||||
|
|
||||||
log.info('Veilid version: $veilidVersion');
|
log.info('Veilid version: $veilidVersion');
|
||||||
|
|
||||||
final updateStream = await Veilid.instance
|
Stream<VeilidUpdate> updateStream;
|
||||||
|
|
||||||
|
try {
|
||||||
|
log.debug('Starting VeilidCore');
|
||||||
|
updateStream = await Veilid.instance
|
||||||
.startupVeilidCore(await getVeilidConfig(kIsWeb, VeilidChatApp.name));
|
.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) {
|
_updateSubscription = updateStream.listen((update) {
|
||||||
if (update is VeilidLog) {
|
if (update is VeilidLog) {
|
||||||
processLog(update);
|
processLog(update);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue