-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logo on welcome back page remove extra button to forget wallet add logo when user has no private drives
- Loading branch information
1 parent
6fed877
commit bc22d07
Showing
18 changed files
with
227 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
lib/user/name/domain/repository/profile_logo_repository.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:ardrive/utils/key_value_store.dart'; | ||
import 'package:ardrive/utils/logger.dart'; | ||
|
||
abstract class ProfileLogoRepository { | ||
Future<String?> getProfileLogoTxId(String walletAddress); | ||
Future<void> setProfileLogoTxId(String walletAddress, String txId); | ||
|
||
factory ProfileLogoRepository(KeyValueStore keyValueStore) { | ||
return ProfileLogoRepositoryImpl( | ||
keyValueStore: keyValueStore, | ||
); | ||
} | ||
} | ||
|
||
class ProfileLogoRepositoryImpl implements ProfileLogoRepository { | ||
final KeyValueStore _keyValueStore; | ||
|
||
ProfileLogoRepositoryImpl({ | ||
required KeyValueStore keyValueStore, | ||
}) : _keyValueStore = keyValueStore; | ||
|
||
@override | ||
Future<String?> getProfileLogoTxId(String walletAddress) async { | ||
final lastSet = | ||
await _keyValueStore.getString('profile_logo_last_set_$walletAddress'); | ||
|
||
if (lastSet != null && | ||
DateTime.now() | ||
.isBefore(DateTime.parse(lastSet).add(const Duration(hours: 1)))) { | ||
logger.d('Getting profile logo tx id from cache'); | ||
return _keyValueStore.getString('profile_logo_tx_id_$walletAddress'); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
@override | ||
Future<void> setProfileLogoTxId(String walletAddress, String txId) async { | ||
// set last time the profile logo was set | ||
await _keyValueStore.putString( | ||
'profile_logo_last_set_$walletAddress', | ||
DateTime.now().toIso8601String(), | ||
); | ||
|
||
await _keyValueStore.putString( | ||
'profile_logo_tx_id_$walletAddress', | ||
txId, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.