diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 2c9100d..7abb008 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -136,7 +136,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 100 - name: Check runner tools run: | @@ -178,7 +178,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 100 - name: Check runner tools run: | diff --git a/lib/ui/screens/edit_account_screen.dart b/lib/ui/screens/edit_account_screen.dart index 69ce0f2..56bb76b 100644 --- a/lib/ui/screens/edit_account_screen.dart +++ b/lib/ui/screens/edit_account_screen.dart @@ -360,7 +360,12 @@ class _EditAccountScreenState extends ConsumerState { : null, ), const SizedBox(height: 8), - FilledButton(onPressed: _save, child: const Text('Save')), + FilledButton( + onPressed: _hasStoredPassword || _passwordCtrl.text.isNotEmpty + ? _save + : null, + child: const Text('Save'), + ), ], ), ), diff --git a/test/widget/edit_account_screen_test.dart b/test/widget/edit_account_screen_test.dart index 6178474..e06bba5 100644 --- a/test/widget/edit_account_screen_test.dart +++ b/test/widget/edit_account_screen_test.dart @@ -163,6 +163,30 @@ void main() { expect(button.onPressed, isNotNull); }); + testWidgets('save button is disabled when no password stored or entered', ( + tester, + ) async { + tester.view.physicalSize = const Size(800, 1400); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + + await tester.pumpWidget( + buildApp( + initialLocation: '/accounts/acc-1/edit', + overrides: baseOverrides( + accounts: [kTestAccount], + hasStoredPassword: false, + ), + ), + ); + await tester.pumpAndSettle(); + + final button = tester + .widget(find.widgetWithText(FilledButton, 'Save')); + expect(button.onPressed, isNull); + }); + testWidgets('connection error shows error message', (tester) async { tester.view.physicalSize = const Size(800, 1400); tester.view.devicePixelRatio = 1.0;