Files
zapstore/lib/utils/debug_utils.dart
T
Henrique Velloso 9fd0eecb83 - Updated app ID references from dev.zapstore.alpha to dev.zapstore.app across multiple YAML flow files to standardize the application identifier.
- Added a new flow for setting up the Amber test account to streamline automated testing processes.
- Improved existing flows to handle various installation scenarios, including older version installations and update verifications.
- Introduced a new test script for bulk updating multiple apps, ensuring all updates are visible and handled correctly.
- Enhanced test specifications to reflect changes in app ID and flow behaviors, ensuring consistency in automated tests.
2026-02-18 20:24:52 -03:00

41 lines
1.2 KiB
Dart

/// Debug utilities for development and testing
library;
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:models/models.dart';
/// Check if the current user is in debug mode based on their pubkey
bool isDebugMode(String? pubkey) {
if (pubkey == null) return false;
const allowedHexKeys = {
'726a1e261cc6474674e8285e3951b3bb139be9a773d1acf49dc868db861a1c11',
'227ce06aa5fb84bf70f25d887519374d1bfd3e1ffb75697bb0aa8f6396f32e43',
'24480686b56234a240fd9827209b584847f3d4f9657f0d9a97aec5320a264acb',
'fdc6b3ce357c8f149f9bfefdfc2a3f1a6d2f25aa512761dea299f78aafeb00e7', // test automation account
};
// Try direct comparison first (hex format)
if (allowedHexKeys.contains(pubkey)) {
return true;
}
// Try converting from npub if needed
try {
if (pubkey.startsWith('npub')) {
final decoded = Utils.decodeShareableIdentifier(pubkey);
if (decoded is ProfileData && allowedHexKeys.contains(decoded.pubkey)) {
return true;
}
}
} catch (e) {
// Failed to decode npub
}
return false;
}
/// Provider that exposes a Ref for use in functions that need consistent Ref type
/// Usage: ref.read(refProvider) to get a Ref from WidgetRef context
final refProvider = Provider<Ref>((ref) => ref);