Skip to content

Commit

Permalink
chore: Not using the same storage location in debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyost committed Jul 12, 2024
1 parent 77617b6 commit 23e5b47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/model/backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:open_authenticator/app.dart';
import 'package:open_authenticator/model/crypto.dart';
Expand Down Expand Up @@ -53,7 +54,8 @@ class BackupStore extends AsyncNotifier<List<Backup>> {

/// Returns the backup directory.
static Future<Directory> _getBackupsDirectory({bool create = false}) async {
Directory directory = Directory(join((await getApplicationDocumentsDirectory()).path, '${App.appName} Backups'));
String name = '${App.appName} Backups${kDebugMode ? ' (Debug)' : ''}';
Directory directory = Directory(join((await getApplicationDocumentsDirectory()).path, name));
if (create && !directory.existsSync()) {
directory.createSync(recursive: true);
}
Expand Down
1 change: 0 additions & 1 deletion lib/model/totp/repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class TotpRepository extends AutoDisposeAsyncNotifier<TotpList> {
for (Totp updatedTotp in decrypted) {
await totpImageCacheManager.cacheImage(updatedTotp);
}

state = AsyncData(
TotpList._fromListAndStorage(
list: _mergeToCurrentList(totpList, totps: decrypted),
Expand Down

0 comments on commit 23e5b47

Please sign in to comment.