Skip to content

Commit

Permalink
hotfix(index-item): correctly check version
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangvu12 committed Jan 27, 2024
1 parent 2334a3a commit 24206c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kaguya-app",
"version": "0.7.1-alpha",
"version": "0.7.1.1-alpha",
"private": true,
"scripts": {
"start": "expo start --dev-client --tunnel",
Expand Down
8 changes: 3 additions & 5 deletions src/screens/module/screens/remote/components/index-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,18 @@ const IndexItem: React.FC<IndexItemProps> = ({
data={index.modules}
keyExtractor={(item) => item.id}
renderItem={({ item }) => {
const hasInstalled = modules?.some(
const module = modules?.find(
(module) =>
module.id === item.id &&
module.info.author === item.info.author
);

const hasNewVersion = modules?.some(
(module) => hasInstalled && module.version !== item.version
);
const hasNewVersion = module?.version !== item.version;

return (
<RemoteModuleItem
hasNewVersion={hasNewVersion}
hasInstalled={hasInstalled}
hasInstalled={!!module}
module={item}
/>
);
Expand Down

0 comments on commit 24206c1

Please sign in to comment.