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" v-if="drawer"
:direction="drawerDirection" :direction="drawerDirection"
:before-close="closeDialog" :before-close="closeDialog"
:visible="dialogVisible" :visible="true"
:size="drawerWidth" :size="drawerWidth"
> >
<template v-slot:title> <template v-slot:title>

View file

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

View file

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