Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Fix updating apps doesn't work correctly #309

Merged
merged 1 commit into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/components/shared/app-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const AppCard = (props) => {
className={classes.actionButton}
color="primary"
size="medium"
onClick={() => onUpdateApp(id, name, url, icon, mailtoHandler)}
onClick={() => onUpdateApp(engine, id, name, url, icon, mailtoHandler)}
>
Update
</Button>
Expand Down Expand Up @@ -152,9 +152,11 @@ const AppCard = (props) => {
<div className={classes.actionContainer}>
{renderActionsElement()}
</div>
<div className={classes.engine}>
{engine}
</div>
{engine && (
<div className={classes.engine}>
{engine}
</div>
)}
</Paper>
</Grid>
);
Expand Down
8 changes: 4 additions & 4 deletions src/state/app-management/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const installApp = (engine, id, name, url, icon, mailtoHandler) => (dispa
return null;
};

export const updateApp = (id, name, url, icon, mailtoHandler) => (dispatch, getState) => {
export const updateApp = (engine, id, name, url, icon, mailtoHandler) => (dispatch, getState) => {
const state = getState();

const { latestTemplateVersion } = state.general;
Expand All @@ -65,7 +65,7 @@ export const updateApp = (id, name, url, icon, mailtoHandler) => (dispatch, getS
// download icon when updating apps in the catalog
const iconUrl = id.startsWith('custom-') ? icon : `https://s3.getwebcatalog.com/apps/${id}/${id}-icon.png`;

return requestInstallApp(id, name, url, iconUrl, mailtoHandler);
return requestInstallApp(engine, id, name, url, iconUrl, mailtoHandler);
};

export const updateAllApps = () => (dispatch, getState) => {
Expand All @@ -81,13 +81,13 @@ export const updateAllApps = () => (dispatch, getState) => {

outdatedApps.forEach((app) => {
const {
id, name, url, icon, mailtoHandler,
engine, id, name, url, icon, mailtoHandler,
} = app;

// download icon when updating apps in the catalog
const iconUrl = id.startsWith('custom-') ? icon : `https://s3.getwebcatalog.com/apps/${id}/${id}-icon.png`;

return requestInstallApp(id, name, url, iconUrl, mailtoHandler);
return requestInstallApp(engine, id, name, url, iconUrl, mailtoHandler);
});

return null;
Expand Down