Skip to content

Commit 45bd8d1

Browse files
add timeout to the splash-screen acquire lock
1 parent 499e181 commit 45bd8d1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

mobile/lib/pages/common/splash_screen.page.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ class SplashScreenPageState extends ConsumerState<SplashScreenPage> {
3030
final lockManager = ref.read(isolateLockManagerProvider(kIsolateLockManagerPort));
3131

3232
lockManager.requestHolderToClose();
33-
lockManager.acquireLock().whenComplete(
34-
() => ref
35-
.read(authProvider.notifier)
36-
.setOpenApiServiceEndpoint()
37-
.then(logConnectionInfo)
38-
.whenComplete(() => resumeSession()),
39-
);
33+
lockManager
34+
.acquireLock()
35+
.timeout(const Duration(seconds: 5))
36+
.whenComplete(
37+
() => ref
38+
.read(authProvider.notifier)
39+
.setOpenApiServiceEndpoint()
40+
.then(logConnectionInfo)
41+
.whenComplete(() => resumeSession()),
42+
);
4043
}
4144

4245
void logConnectionInfo(String? endpoint) {

0 commit comments

Comments
 (0)