From c1adadb9bf8ae9918ee22657694d92a725e5ad82 Mon Sep 17 00:00:00 2001 From: Daniel Poss Date: Sun, 16 Mar 2025 00:10:10 -0500 Subject: [PATCH 1/2] Add print step for generated environment file in workflows; remove mock Discord service instantiation --- .github/workflows/build-pr.yml | 6 ++++++ .github/workflows/main.yml | 3 +++ lib/main.dart | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 0ad3071..9608da9 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -68,6 +68,9 @@ jobs: - name: Generate Envied Files run: flutter pub run build_runner build --delete-conflicting-outputs + - name: Print generated environment file + run: cat ./lib/core/config/env.g.dart + - name: Golden Tests run: flutter test "test/widget/" >> $GITHUB_STEP_SUMMARY @@ -106,5 +109,8 @@ jobs: - name: Generate Envied Files run: flutter pub run build_runner build --delete-conflicting-outputs + - name: Print generated environment file + run: cat ./lib/core/config/env.g.dart + - name: Build Web Bundle run: flutter build web >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4ef55f..0e7743c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,6 +42,9 @@ jobs: dart scripts/generate_git_info.dart >> $GITHUB_STEP_SUMMARY dart run build_runner build --delete-conflicting-outputs + - name: Print generated environment file + run: cat ./lib/core/config/env.g.dart + - name: Build Web Bundle run: flutter build web --release diff --git a/lib/main.dart b/lib/main.dart index e536747..c28acf3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -113,9 +113,7 @@ class _MyAppState extends State { ChangeNotifierProvider(create: (context) => widget.modelFirstTime), ChangeNotifierProvider(create: (context) => widget.modelTheme), Provider( - create: (_) => Env.mockDiscordService == 'true' - ? DiscordServiceMockImpl() - : DiscordServiceImpl(setupOauth2Helper())), + create: (_) => DiscordServiceImpl(setupOauth2Helper())), Provider( create: (_) => ApiClient(basePath: Env.clashbotServiceUrl)), ProxyProvider( From 694e1ceff4f92399212e719965fb36271ac193a0 Mon Sep 17 00:00:00 2001 From: Daniel Poss Date: Sun, 16 Mar 2025 00:14:57 -0500 Subject: [PATCH 2/2] Replace mock Discord OAuth2 client with real implementation --- lib/globals/global_settings.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/globals/global_settings.dart b/lib/globals/global_settings.dart index 2f93195..ffe2ae6 100644 --- a/lib/globals/global_settings.dart +++ b/lib/globals/global_settings.dart @@ -33,7 +33,7 @@ abstract class AppGlobalSettings { } OAuth2Helper setupOauth2Helper() { - var client = MockDiscordOauth2Client( + var client = DiscordOauth2Client( redirectUri: "${Uri.base.origin}/login/index.html", customUriScheme: '', );