Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove skip initial setting #1174

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/unit_test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# This is a basic workflow to help you get started with Actions
name: ci

name: Test

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main, feature/* ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,6 @@ class InitialSettingPillSheetGroupPage extends HookConsumerWidget {
return null;
}, [isAppleLinked, isGoogleLinked]);

// Skip initial setting when user already set setting.
final navigator = Navigator.of(context);
useEffect(() {
void f() async {
if (user.asData?.value.setting != null) {
await AppRouter.endInitialSetting(navigator, didEndInitialSettingNotifier);
}
}

f();
return null;
}, [user]);

return HUD(
shown: state.isLoading,
child: Scaffold(
Expand Down
51 changes: 26 additions & 25 deletions lib/features/root/resolver/skip_initial_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,36 @@ class SkipInitialSetting extends HookConsumerWidget {
required this.initialSettingPageBuilder,
});

// 起動時にログインができなくなるユーザーがいてこれが起因している可能性がある。今は使用していないので一時的にコメントアウト
@override
Widget build(BuildContext context, WidgetRef ref) {
final remoteConfigParameter = ref.watch(remoteConfigParameterProvider);
final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider);
final didEndInitialSettingNotifier = ref.watch(boolSharedPreferencesProvider(BoolKey.didEndInitialSetting).notifier);
final initialSettingStateNotifier = ref.watch(initialSettingStateNotifierProvider.notifier);
final navigator = Navigator.of(context);
// final remoteConfigParameter = ref.watch(remoteConfigParameterProvider);
// final registerReminderLocalNotification = ref.watch(registerReminderLocalNotificationProvider);
// final didEndInitialSettingNotifier = ref.watch(boolSharedPreferencesProvider(BoolKey.didEndInitialSetting).notifier);
// final initialSettingStateNotifier = ref.watch(initialSettingStateNotifierProvider.notifier);
// final navigator = Navigator.of(context);

useEffect(() {
final f = (() async {
if (remoteConfigParameter.skipInitialSetting) {
try {
await initialSettingStateNotifier.register();
await registerReminderLocalNotification();
await AppRouter.endInitialSetting(navigator, didEndInitialSettingNotifier);
} catch (error) {
if (context.mounted) showErrorAlert(context, error.toString());
}
}
});
// useEffect(() {
// final f = (() async {
// if (remoteConfigParameter.skipInitialSetting) {
// try {
// await initialSettingStateNotifier.register();
// await registerReminderLocalNotification();
// await AppRouter.endInitialSetting(navigator, didEndInitialSettingNotifier);
// } catch (error) {
// if (context.mounted) showErrorAlert(context, error.toString());
// }
// }
// });

f();
return null;
}, []);
// f();
// return null;
// }, []);

if (remoteConfigParameter.skipInitialSetting) {
return homePageBuilder(context);
} else {
return initialSettingPageBuilder(context);
}
// if (remoteConfigParameter.skipInitialSetting) {
// return homePageBuilder(context);
// } else {
return initialSettingPageBuilder(context);
// }
}
}
Loading