recover password feature
This commit is contained in:
@@ -166,9 +166,11 @@ export const clearCache = async (): Promise<void> => {
|
||||
export const clearReservasCache = async (): Promise<void> => {
|
||||
try {
|
||||
const keys = await AsyncStorage.getAllKeys();
|
||||
const reservaKeys = keys.filter(key =>
|
||||
key === STORAGE_KEYS.RESERVAS ||
|
||||
key.startsWith(STORAGE_KEYS.RESERVA_DETAIL)
|
||||
const reservaKeys = keys.filter(
|
||||
(key) =>
|
||||
key === STORAGE_KEYS.RESERVAS ||
|
||||
key.startsWith(STORAGE_KEYS.RESERVA_DETAIL) ||
|
||||
key.startsWith(STORAGE_KEYS.RESERVA_FULL),
|
||||
);
|
||||
await AsyncStorage.multiRemove(reservaKeys);
|
||||
} catch (error) {
|
||||
@@ -176,6 +178,22 @@ export const clearReservasCache = async (): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
/** Dados de sessão do utilizador — mantém contactos da agência (partilhados). */
|
||||
export const clearUserSessionCache = async (): Promise<void> => {
|
||||
try {
|
||||
const keys = await AsyncStorage.getAllKeys();
|
||||
const sessionKeys = keys.filter(
|
||||
(key) =>
|
||||
key.startsWith("@cruiseLovers:") &&
|
||||
key !== STORAGE_KEYS.CONTACTS &&
|
||||
key !== STORAGE_KEYS.SOCIALS,
|
||||
);
|
||||
await AsyncStorage.multiRemove(sessionKeys);
|
||||
} catch (error) {
|
||||
console.error("Erro ao limpar cache da sessão:", error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Armazena informações do perfil no cache
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user