Skip to content

Commit

Permalink
[issue-1193] Improve default enable config Show zero balance
Browse files Browse the repository at this point in the history
  • Loading branch information
dominhquang committed Dec 26, 2023
1 parent 579e338 commit 60ca6b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import { Warning } from 'phosphor-react-native';
import { Images } from 'assets/index';
import Text from 'components/Text';
import i18n from 'utils/i18n/i18n';
import { mmkvStore } from 'utils/storage';
import { updateShowZeroBalanceState } from 'stores/utils';

const layerScreenStyle: StyleProp<any> = {
top: 0,
Expand Down Expand Up @@ -158,6 +160,7 @@ export const App = () => {
const { checkIsShowBuyToken } = useShowBuyToken();
const { getDAppsData } = useGetDAppList();
const [needUpdateChrome, setNeedUpdateChrome] = useState<boolean>(false);
const isEnableShowZeroBalanceFirstTime = mmkvStore.getBoolean('isEnableShowZeroBalanceFirstTime');

// Enable lock screen on the start app
useEffect(() => {
Expand Down Expand Up @@ -200,6 +203,11 @@ export const App = () => {
DeviceEventEmitter.addListener(NEED_UPDATE_CHROME, (data: boolean) => {
setNeedUpdateChrome(data);
});

if (!isEnableShowZeroBalanceFirstTime) {
updateShowZeroBalanceState(true);
mmkvStore.set('isEnableShowZeroBalanceFirstTime', true);
}
// if (buildNumber === 1) {
// Set default value on the first time install
// const buildNumberInt = parseInt(getBuildNumber(), 10);
Expand Down

0 comments on commit 60ca6b7

Please sign in to comment.