Skip to content

Commit 88ec8ca

Browse files
committed
Teams #42
1 parent 6c59aea commit 88ec8ca

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/src/auth/codelessly_auth_manager.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ class CodelesslyAuthManager extends AuthManager {
321321
_authStreamController.add(_authData);
322322
await cacheManager.delete(authCacheKey);
323323
log('Failed to authenticate token.');
324-
return;
324+
325+
throw CodelesslyException.notAuthenticated();
325326
}
326327
} on CodelesslyException {
327328
rethrow;

lib/src/ui/codelessly_error_screen.dart

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CodelesslyErrorScreen extends StatelessWidget {
1717

1818
@override
1919
Widget build(BuildContext context) {
20-
if (!publishSource.isPreview) return const SizedBox.shrink();
20+
// if (!publishSource.isPreview) return const SizedBox.shrink();
2121

2222
final String message;
2323
String? title;
@@ -110,11 +110,12 @@ class CodelesslyErrorScreen extends StatelessWidget {
110110
style: Theme.of(context).textTheme.bodyMedium,
111111
),
112112
if (exception case CodelesslyException ex)
113-
Text(
114-
ex.originalException.toString(),
115-
textAlign: TextAlign.left,
116-
style: Theme.of(context).textTheme.bodyMedium,
117-
),
113+
if (ex.originalException != null)
114+
Text(
115+
ex.originalException.toString(),
116+
textAlign: TextAlign.left,
117+
style: Theme.of(context).textTheme.bodyMedium,
118+
),
118119
],
119120
),
120121
),

0 commit comments

Comments
 (0)