Skip to content
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

[expo] implement badge count logic. #219

Merged
merged 1 commit into from
Jan 8, 2025
Merged

[expo] implement badge count logic. #219

merged 1 commit into from
Jan 8, 2025

Conversation

yssk22
Copy link
Owner

@yssk22 yssk22 commented Jan 8, 2025

Summary

app badge count is sum of followings:

  • home badge count
    • of unread feeds item within 24 hours.

  • upfc badge count
    • of pending applications.

those are loaded in HomeContext so we also show badge counts in each tab.

Test

  • expo

Issue

**Summary**

app badge count is sum of followings:

- home badge count
  - # of unread feeds item within 24 hours.
- upfc badge count
  - # of pending applications.

those are loaded in HomeContext so we also show badge counts in each tab.

**Test**

- expo

**Issue**

- #177
@yssk22 yssk22 merged commit 8a4c68e into main Jan 8, 2025
5 checks passed
yssk22 added a commit that referenced this pull request Jan 9, 2025
**Summary**

We noticed that #219 introduced the regression of HomeTab rendering and the root cause was
the 'rerendering' caused by useHomeTabContext() in HomeTab, which triggered 'unmount' of tabs
created by `Tabs.map()`

To avoid unmount while rerendering, we need to move the `Tabs.map()` to the fixed list of components instead of an array.

Also to ensure sections are properly cached by SectionList, we fixed keyExtractor logic, which can be moved to each `SectionListRender` class
so that React can evaluate the key by default instead of having an override `keyExtractor` function in the original SectionList.

**Test**

- expo

**Issue**

- N/A
yssk22 added a commit that referenced this pull request Jan 9, 2025
**Summary**

We noticed that #219 introduced the regression of HomeTab rendering and the root cause was
the 'rerendering' caused by useHomeTabContext() in HomeTab, which triggered 'unmount' of tabs
created by `Tabs.map()`

To avoid unmount while rerendering, we need to move the `Tabs.map()` to the fixed list of components instead of an array.

Also to ensure sections are properly cached by SectionList, we fixed keyExtractor logic, which can be moved to each `SectionListRender` class
so that React can evaluate the key by default instead of having an override `keyExtractor` function in the original SectionList.

**Test**

- expo

**Issue**

- N/A
This was referenced Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant