recover password feature
This commit is contained in:
@@ -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[],
|
||||
|
||||
Reference in New Issue
Block a user