-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: save last selected account #34
base: master
Are you sure you want to change the base?
Conversation
React.useEffect(() => { | ||
async function init() { | ||
try { | ||
const lastSelectedAssets = await AsyncStorage.getItem( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we turn these getter and setter to react hooks? https://usehooks.com/useLocalStorage/
Toast.success(i18n.t("saveSuccess"), 2, () => { | ||
Toast.success(i18n.t("saveSuccess"), 2, async () => { | ||
try { | ||
await AsyncStorage.setItem("@LastSelectedAssets:key", assets); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about move to mmkv
@@ -104,6 +104,7 @@ | |||
"@apollo/client": "3.3.12", | |||
"@callstack/react-theme-provider": "^2.1.0", | |||
"@expo/vector-icons": "^12.0.4", | |||
"@react-native-async-storage/async-storage": "^1.14.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are there two async-storage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@react-native-community/async-storage not found at npmjs.com
I deleted it.
src/screens/mine-screen/about.tsx
Outdated
@@ -85,18 +79,20 @@ export const About = connect( | |||
|
|||
const [reportAnimateCount, setReportAnimateCount] = useState(0); | |||
const [subscriptionFlash, setSubscriptionFlash] = useState(false); | |||
|
|||
const { getItem, setItem } = useAsyncStorage("@SubscriptionFlash:key"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SubscriptionFlashCard:key
src/common/announcement.tsx
Outdated
"" | ||
); | ||
|
||
const [, setSubFlash] = useAsyncStorage("@SubscriptionFlash:key", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SubscriptionFlashCard:key
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #33