mirror of
https://github.com/strapi/strapi.git
synced 2025-09-23 15:29:27 +00:00
Fix PR feedback
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
87b7aece4c
commit
06ad93aa09
@ -120,40 +120,38 @@ export class Admin extends React.Component {
|
|||||||
getStrapiLatestReleaseSucceeded,
|
getStrapiLatestReleaseSucceeded,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (!STRAPI_ADMIN_UPDATE_NOTIFICATION === 'true') {
|
if (STRAPI_ADMIN_UPDATE_NOTIFICATION === 'true') {
|
||||||
return;
|
try {
|
||||||
}
|
const {
|
||||||
|
data: { tag_name },
|
||||||
|
} = await axios.get('https://api.github.com/repos/strapi/strapi/releases/latest');
|
||||||
|
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name);
|
||||||
|
|
||||||
try {
|
getStrapiLatestReleaseSucceeded(tag_name, shouldUpdateStrapi);
|
||||||
const {
|
|
||||||
data: { tag_name },
|
|
||||||
} = await axios.get('https://api.github.com/repos/strapi/strapi/releases/latest');
|
|
||||||
const shouldUpdateStrapi = checkLatestStrapiVersion(strapiVersion, tag_name);
|
|
||||||
|
|
||||||
getStrapiLatestReleaseSucceeded(tag_name, shouldUpdateStrapi);
|
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
|
||||||
|
|
||||||
const showUpdateNotif = !JSON.parse(localStorage.getItem('STRAPI_UPDATE_NOTIF'));
|
if (!showUpdateNotif) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!showUpdateNotif) {
|
if (shouldUpdateStrapi) {
|
||||||
return;
|
strapi.notification.toggle({
|
||||||
}
|
type: 'info',
|
||||||
|
message: { id: 'notification.version.update.message' },
|
||||||
if (shouldUpdateStrapi) {
|
link: {
|
||||||
strapi.notification.toggle({
|
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
||||||
type: 'info',
|
label: {
|
||||||
message: { id: 'notification.version.update.message' },
|
id: 'notification.version.update.link',
|
||||||
link: {
|
},
|
||||||
url: `https://github.com/strapi/strapi/releases/tag/${tag_name}`,
|
|
||||||
label: {
|
|
||||||
id: 'notification.version.update.link',
|
|
||||||
},
|
},
|
||||||
},
|
blockTransition: true,
|
||||||
blockTransition: true,
|
onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true),
|
||||||
onClose: () => localStorage.setItem('STRAPI_UPDATE_NOTIF', true),
|
});
|
||||||
});
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// Silent
|
||||||
}
|
}
|
||||||
} catch (err) {
|
|
||||||
// Silent
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user