Commit 7074fd2

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-09-02 06:23:01
Fix dateswitcher clipping (#400)
* fix desktop upgrade * fix interval picker button type * test fix --------- Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent d084c3f
Changed files (3)
app/lib/data_util/interval_picker.dart
@@ -39,9 +39,9 @@ class IntervalPicker extends StatelessWidget {
           const SizedBox(height: 2),
           Row(
             children: [
-              IconButton(
-                onPressed: () => intervall.moveDataRangeByStep(-1),
-                icon: const Icon(Icons.chevron_left, size: 48),
+              MaterialButton(
+                onPressed: () => intervall.moveDataRangeByStep(-11),
+                child: const Icon(Icons.chevron_left, size: 48),
               ),
               Expanded(
                 child: DropdownButton<TimeStep>(
app/lib/app.dart
@@ -165,8 +165,10 @@ class _AppState extends State<App> {
         );
         File(join(dbPath, 'config.db')).copySync(join(dbPath, 'v39_config.db.backup'));
         File(join(dbPath, 'config.db')).deleteSync();
-        File(join(dbPath, 'config.db-journal')).copySync(join(dbPath, 'v39_config.db-journal.backup'));
-        File(join(dbPath, 'config.db-journal')).deleteSync();
+        if (File(join(dbPath, 'config.db-journal')).existsSync()) {
+          File(join(dbPath, 'config.db-journal')).copySync(join(dbPath, 'v39_config.db-journal.backup'));
+          File(join(dbPath, 'config.db-journal')).deleteSync();
+        }
       } catch (e, stack) {
         await ErrorReporting.reportCriticalError('Error upgrading to file based settings:', '$e\n$stack',);
       }
app/test/data_util/interval_picker_test.dart
@@ -15,6 +15,7 @@ void main() {
       child: IntervalPicker(type: IntervalStoreManagerLocation.mainPage)
     )));
     expect(find.byType(DropdownButton<TimeStep>), findsOneWidget);
+    expect(find.byType(MaterialButton), findsNWidgets(2));
     expect(find.byIcon(Icons.chevron_left), findsOneWidget);
     expect(find.byIcon(Icons.chevron_right), findsOneWidget);
     expect(
@@ -59,6 +60,5 @@ void main() {
     await tester.tap(find.text(localizations.custom));
     await tester.pumpAndSettle();
     expect(find.byType(DateRangePickerDialog), findsOneWidget);
-
   });
 }