From f9f016b9326bcdd49b6e7e6ae597ef6cf720f9d2 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Mon, 28 Jun 2021 20:50:13 +0900 Subject: [PATCH] add reset button for db --- src/components/Settings.tsx | 16 ++++++++++++++-- src/storage/asyncstorage.ts | 17 +++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 6d4248b..cb39dc7 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -5,11 +5,23 @@ import React from 'react'; import { Button, Text, View } from 'react-native'; import { v4 as uuidv4 } from 'uuid'; import { appSettingsAtom } from '../state/settings'; +import { getAllKeys, multiRemove } from '../storage/asyncstorage'; +import text from '../styles/text'; const TestControls = () => { const navigation = useNavigation(); + + const removeAllKeys = async () => { + const allKeys = await getAllKeys(); + await multiRemove(allKeys); + } + return ( +