Skip to content

Commit

Permalink
add comments and api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ishpaul777 committed Dec 13, 2024
1 parent 3e6c815 commit db57944
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
3 changes: 3 additions & 0 deletions src/hooks/useBottomTabIsFocused.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ const useBottomTabIsFocused = () => {
const isFocused = useIsFocused();
const topmostFullScreenName = useNavigationState<RootStackParamList, NavigationPartialRoute<FullScreenName> | undefined>(getTopmostFullScreenRoute);
const topmostCentralPane = useNavigationState<RootStackParamList, NavigationPartialRoute<CentralPaneName> | undefined>(getTopmostCentralPaneRoute);
// if there is a full screen like worspace settings, not found screen, etc. then bottom tab should is not focused
if (topmostFullScreenName) {
return false;
}
// on search screen, isFocused is returned false but it is focused
if (shouldUseNarrowLayout) {
return isFocused || topmostCentralPane?.name === SCREENS.SEARCH.CENTRAL_PANE;
}
// on desktop screen size isFocused is always returned as false so we can't rely on it to determine if bottom tab is focused
return isFocused || Object.keys(CENTRAL_PANE_SCREENS).includes(topmostCentralPane?.name ?? '');
};

Expand Down
23 changes: 10 additions & 13 deletions src/libs/actions/Welcome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,16 @@ function setSelfTourViewed(shouldUpdateOnyxDataOnlyLocally = false) {

function dismissProductTraining(elementName: string) {
const date = new Date();
// const optimisticData = [
// {
// onyxMethod: Onyx.METHOD.MERGE,
// key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
// value: {
// [elementName]: DateUtils.getDBTime(date.valueOf()),
// },
// },
// ];
// API.write(WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING, {name: elementName}, {optimisticData});
Onyx.merge(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {
[elementName]: DateUtils.getDBTime(date.valueOf()),
});
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING,
value: {
[elementName]: DateUtils.getDBTime(date.valueOf()),
},
},
];
API.write(WRITE_COMMANDS.DISMISS_PRODUCT_TRAINING, {name: elementName}, {optimisticData});
}

export {
Expand Down

0 comments on commit db57944

Please sign in to comment.