Skip to content

Commit 0c1962f

Browse files
authored
Merge branch 'main' into feat/investigate-schedule-data-flow
2 parents 27f6513 + b3eec18 commit 0c1962f

17 files changed

Lines changed: 423 additions & 288 deletions

File tree

ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ SPEC CHECKSUMS:
213213
FirebaseCoreInternal: df24ce5af28864660ecbd13596fc8dd3a8c34629
214214
FirebaseInstallations: 6c963bd2a86aca0481eef4f48f5a4df783ae5917
215215
FirebaseMessaging: 487b634ccdf6f7b7ff180fdcb2a9935490f764e8
216-
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
216+
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
217217
flutter_appauth: 914057fda669db5073d3ca9d94ea932e7df3c964
218218
flutter_local_notifications: 395056b3175ba4f08480a7c5de30cd36d69827e4
219219
flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13

lib/core/dio/interceptors/token_interceptor.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ class TokenInterceptor implements InterceptorsWrapper {
7474
_requestsNeedRetry.clear();
7575
_isRefreshing = false;
7676
} else {
77+
for (final requestNeedRetry in _requestsNeedRetry) {
78+
requestNeedRetry.handler.reject(
79+
DioException(
80+
requestOptions: requestNeedRetry.options,
81+
response: response,
82+
type: err.type,
83+
error: err.error,
84+
message: err.message,
85+
),
86+
);
87+
}
7788
_requestsNeedRetry.clear();
7889
// if refresh fail, force logout user here
7990
try {

lib/data/repositories/user_repository_impl.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:dio/dio.dart';
12
import 'package:flutter/material.dart';
23
import 'package:google_sign_in/google_sign_in.dart';
34
import 'package:injectable/injectable.dart';
@@ -34,6 +35,13 @@ class UserRepositoryImpl implements UserRepository {
3435
final user = await _authenticationRemoteDataSource.getUser();
3536
_userStreamController.add(user);
3637
return user;
38+
} on DioException catch (e) {
39+
if (e.response?.statusCode == 401) {
40+
await _tokenLocalDataSource.deleteToken();
41+
_userStreamController.add(const UserEntity.empty());
42+
return const UserEntity.empty();
43+
}
44+
rethrow;
3745
} catch (e) {
3846
rethrow;
3947
}

lib/l10n/app_ko.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"calendarTitle": "캘린더",
33
"error": "오류",
4-
"noSchedules": "일정이 없습니다",
4+
"noSchedules": "약속이 없어요",
55
"setSpareTimeTitle": "여유시간을 설정해주세요",
66
"setSpareTimeDescription": "설정한 여유시간만큼 일찍 도착할 수 있어요.",
77
"setSpareTimeWarning": "여유시간은 혹시 모를 상황을 위해 꼭 설정해야 돼요.",

lib/l10n/app_localizations_ko.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppLocalizationsKo extends AppLocalizations {
1515
String get error => '오류';
1616

1717
@override
18-
String get noSchedules => '일정이 없습니다';
18+
String get noSchedules => '약속이 없어요';
1919

2020
@override
2121
String get setSpareTimeTitle => '여유시간을 설정해주세요';

lib/main.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import 'dart:async';
2+
13
import 'package:firebase_core/firebase_core.dart';
24
import 'package:firebase_messaging/firebase_messaging.dart';
3-
import 'package:flutter/foundation.dart';
45
import 'package:flutter/material.dart';
56
import 'package:intl/date_symbol_data_local.dart';
67
import 'package:on_time_front/core/constants/environment_variable.dart';
@@ -25,7 +26,13 @@ void main() async {
2526
debugPrint('[FCM Main] Notification Permission: $permission');
2627

2728
if (permission == AuthorizationStatus.authorized) {
28-
await NotificationService.instance.initialize();
29+
unawaited(
30+
NotificationService.instance.initialize().catchError(
31+
(Object error, StackTrace stackTrace) {
32+
debugPrint('[FCM Main] NotificationService initialize 실패: $error');
33+
},
34+
),
35+
);
2936
} else {
3037
debugPrint('[FCM Main] 알림 권한이 없어 NotificationService를 초기화하지 않습니다');
3138
}

lib/presentation/app/bloc/auth/auth_state.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class AuthState extends Equatable {
1111
: this._(
1212
status: user.map<AuthStatus>(
1313
(entity) => entity.isOnboardingCompleted
14-
? AuthStatus.unauthenticated
14+
? AuthStatus.authenticated
1515
: AuthStatus.onboardingNotCompleted,
1616
empty: (_) => AuthStatus.unauthenticated,
1717
),

lib/presentation/app/screens/app.dart

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,28 @@ class App extends StatelessWidget {
3030
class AppView extends StatelessWidget {
3131
const AppView({super.key});
3232

33+
@override
34+
Widget build(BuildContext context) {
35+
return const _AppRouterView();
36+
}
37+
}
38+
39+
class _AppRouterView extends StatefulWidget {
40+
const _AppRouterView();
41+
42+
@override
43+
State<_AppRouterView> createState() => _AppRouterViewState();
44+
}
45+
46+
class _AppRouterViewState extends State<_AppRouterView> {
47+
late final _router =
48+
goRouterConfig(context.read<AuthBloc>(), context.read<ScheduleBloc>());
49+
3350
@override
3451
Widget build(BuildContext context) {
3552
return MaterialApp.router(
3653
theme: themeData,
37-
routerConfig: goRouterConfig(
38-
context.read<AuthBloc>(), context.read<ScheduleBloc>()),
54+
routerConfig: _router,
3955
localizationsDelegates: AppLocalizations.localizationsDelegates,
4056
supportedLocales: AppLocalizations.supportedLocales,
4157
);

0 commit comments

Comments
 (0)