From f9fb190f8041595e922090f535b0d3daaf8f636d Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Mon, 12 Feb 2024 18:48:02 +1300 Subject: [PATCH] Validate database file imported --- SettingsPage.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SettingsPage.tsx b/SettingsPage.tsx index 5f69b0a..5a783e7 100644 --- a/SettingsPage.tsx +++ b/SettingsPage.tsx @@ -107,6 +107,8 @@ export default function SettingsPage() { ); await AppDataSource.destroy(); const file = await DocumentPicker.pickSingle(); + if (!file.uri.endsWith('.db')) + return toast("File name must end with .db") await FileSystem.cp(file.uri, Dirs.DatabaseDir + "/massive.db"); try {