Add unit tests for ChannelMessage replies and update untranslated.json with new translations
This commit is contained in:
1 parent
c1680208d8
commit
0e8a8bd8c4
61 files changed
+9701
-1140
No files matched your search
@@ -10,6 +10,18 @@ class ChannelRegionStore {
|
||||
|
||||
String get keyFor => '$_keyPrefix$publicKeyHex';
|
||||
|
||||
String get _defaultKey => 'default_region_$publicKeyHex';
|
||||
|
||||
String loadDefaultRegion() {
|
||||
if (publicKeyHex.isEmpty) return '';
|
||||
return PrefsManager.instance.getString(_defaultKey) ?? '';
|
||||
}
|
||||
|
||||
Future<void> saveDefaultRegion(String region) async {
|
||||
if (publicKeyHex.isEmpty) return;
|
||||
await PrefsManager.instance.setString(_defaultKey, region);
|
||||
}
|
||||
|
||||
Future<String> loadRegion(int channelIndex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
|
||||
@@ -47,6 +47,9 @@ class RegionStore {
|
||||
await channelRegionStore.saveRegion(channel.index, '');
|
||||
}
|
||||
}
|
||||
if (channelRegionStore.loadDefaultRegion() == region) {
|
||||
await channelRegionStore.saveDefaultRegion('');
|
||||
}
|
||||
regions.remove(region);
|
||||
saveRegions(regions);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user