fix bug when no updates

This commit is contained in:
Mutasem 2021-07-02 14:05:47 +02:00
parent 4abb2e7daa
commit 37d11ff71f
3 changed files with 7 additions and 2 deletions

View file

@ -4,7 +4,7 @@
v-if="drawer"
:direction="drawerDirection"
:before-close="closeDialog"
:visible="dialogVisible"
:visible="true"
:size="drawerWidth"
>
<template v-slot:title>

View file

@ -28,6 +28,9 @@ const module: Module<IUiState, IRootState> = {
isPageLoading: true,
},
getters: {
isVersionsOpen: (state: IUiState) => {
return state.modals[VERSIONS_MODAL_KEY].open;
},
isModalOpen: (state: IUiState) => {
return (name: string) => state.modals[name].open;
},

View file

@ -2239,12 +2239,14 @@ export default mixins(
setTimeout(async () => {
await this.$store.dispatch('versions/fetchVersions');
const currentVersion: IVersion | undefined = this.$store.getters['versions/currentVersion'];
if (currentVersion && currentVersion.hasSecurityIssue) {
const nextVersions: IVersion[] = this.$store.getters['versions/nextVersions'];
if (currentVersion && currentVersion.hasSecurityIssue && nextVersions.length) {
const fixVersion = currentVersion.securityIssueFixVersion;
let message = `Please update to latest version.`;
if (fixVersion) {
message = `Please update to version ${fixVersion} or higher.`;
}
message = `${message}<br/><a class="primary-color">More info</a>`;
this.$showWarning('Critical Update', message, {
onClick: () => {