Fix form keyboard issues and sticky footers in agent screens

This commit is contained in:
Abin Toppo
2026-05-26 16:34:05 +05:30
commit 9ac5e95d52
410 changed files with 86650 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import * as Keychain from 'react-native-keychain';
import type { AuthTokens } from '../../types/app';
const BIOMETRIC_KEY = 'bankcbs.biometricEnabled';
const SESSION_SERVICE = 'com.bankcbs.mobile.session';
export const secureStorage = {
async saveSession(tokens: AuthTokens) {
await Keychain.setGenericPassword('session', JSON.stringify(tokens), {
service: SESSION_SERVICE,
accessible: Keychain.ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
securityLevel: Keychain.SECURITY_LEVEL.SECURE_SOFTWARE,
});
},
async getSession(): Promise<AuthTokens | null> {
const credentials = await Keychain.getGenericPassword({
service: SESSION_SERVICE,
});
if (!credentials) {
return null;
}
return JSON.parse(credentials.password) as AuthTokens;
},
async getAccessToken() {
const session = await this.getSession();
return session?.accessToken ?? null;
},
async clearSession() {
await Keychain.resetGenericPassword({
service: SESSION_SERVICE,
});
},
async setBiometricEnabled(value: boolean) {
await AsyncStorage.setItem(BIOMETRIC_KEY, JSON.stringify(value));
},
async getBiometricEnabled() {
const value = await AsyncStorage.getItem(BIOMETRIC_KEY);
return value ? JSON.parse(value) : false;
},
};