check endpoint exists

This commit is contained in:
Mutasem 2021-07-08 15:40:24 +02:00
parent 967f9e0f7c
commit 67991e8a3d

View file

@ -45,10 +45,10 @@ const module: Module<IVersionsState, IRootState> = {
},
actions: {
async fetchVersions(context: ActionContext<IVersionsState, IRootState>) {
const enabled = context.state.versionNotificationSettings.enabled;
if (enabled) {
const { enabled, endpoint } = context.state.versionNotificationSettings;
if (enabled && endpoint) {
const currentVersion = context.rootState.versionCli;
const versions = await getNextVersions(context.state.versionNotificationSettings.endpoint, currentVersion);
const versions = await getNextVersions(endpoint, currentVersion);
context.commit('setVersions', {versions, currentVersion});
}
},