recover password feature

This commit is contained in:
2026-05-26 11:36:09 +01:00
parent b427fb0f85
commit b48f7783c9
12 changed files with 527 additions and 97 deletions

View File

@@ -128,6 +128,23 @@ export const verificarDocumentosParaDownload = async (
return para;
};
/** Remove documentos descarregados e checksums (ex.: no logout). */
export const clearDownloadedDocuments = async (): Promise<void> => {
try {
const keys = await AsyncStorage.getAllKeys();
const docKeys = keys.filter((key) => key.startsWith("@cruiseLovers:documento:"));
if (docKeys.length > 0) {
await AsyncStorage.multiRemove(docKeys);
}
const info = await FileSystem.getInfoAsync(DOCUMENTOS_DIR);
if (info.exists) {
await FileSystem.deleteAsync(DOCUMENTOS_DIR, { idempotent: true });
}
} catch (error) {
console.error("Erro ao limpar documentos locais:", error);
}
};
// Descarrega múltiplos documentos
export const downloadDocumentos = async (
documentos: DocumentoChecksum[],