base64 fix and turn off dht caching until we have background sync

This commit is contained in:
Christien Rioux 2023-09-30 12:45:32 -04:00
parent c9653bab18
commit d631b7308b
5 changed files with 18 additions and 16 deletions

View File

@ -20,7 +20,7 @@ class ChatSingleContactItemWidget extends ConsumerWidget {
//final textTheme = theme.textTheme;
final scale = theme.extension<ScaleScheme>()!;
final activeChat = ref.watch(activeChatStateProvider).asData?.value;
final activeChat = ref.watch(activeChatStateProvider).value;
final remoteConversationRecordKey =
proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey);
final selected = activeChat == remoteConversationRecordKey;

View File

@ -54,7 +54,10 @@ class PasteInviteDialogState extends ConsumerState<PasteInviteDialog> {
if (lastline <= firstline) {
return;
}
final inviteDataBase64 = lines.sublist(firstline, lastline).join();
final inviteDataBase64 = lines
.sublist(firstline, lastline)
.join()
.replaceAll(RegExp(r'[^A-Za-z0-9\-_]'), '');
final inviteData = base64UrlNoPadDecode(inviteDataBase64);
await validateInviteData(inviteData: inviteData);

View File

@ -15,7 +15,7 @@ class SignalStrengthMeterWidget extends ConsumerWidget {
final scale = theme.extension<ScaleScheme>()!;
const iconSize = 16.0;
final connState = ref.watch(globalConnectionStateProvider).asData?.value;
final connState = ref.watch(globalConnectionStateProvider).value;
if (connState == null) {
return const Icon(Icons.signal_cellular_off, size: iconSize);
}

View File

@ -29,7 +29,7 @@ class RouterNotifier extends _$RouterNotifier implements Listenable {
hasAnyAccount = await ref.watch(
localAccountsProvider.selectAsync((data) => data.isNotEmpty),
);
hasActiveChat = ref.watch(activeChatStateProvider).asData?.value != null;
hasActiveChat = ref.watch(activeChatStateProvider).value != null;
// When this notifier's state changes, inform GoRouter
ref.listenSelf((_, __) {

View File

@ -18,16 +18,15 @@ Future<VeilidConfig> getVeilidChatConfig() async {
config.copyWith(blockStore: config.blockStore.copyWith(delete: true));
}
// // xxx hack
// config = config.copyWith(
// network: config.network.copyWith(
// dht: config.network.dht.copyWith(
// getValueCount: 3,
// getValueFanout: 8,
// getValueTimeoutMs: 5000,
// setValueCount: 4,
// setValueFanout: 10,
// setValueTimeoutMs: 5000)));
return config;
return config.copyWith(
capabilities: const VeilidConfigCapabilities(disable: ['DHTV', 'TUNL']),
// network: config.network.copyWith(
// dht: config.network.dht.copyWith(
// getValueCount: 3,
// getValueFanout: 8,
// getValueTimeoutMs: 5000,
// setValueCount: 4,
// setValueFanout: 10,
// setValueTimeoutMs: 5000))
);
}