dshoreman / servidor

A modern web application for managing servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project logs don't always load

dshoreman opened this issue · comments

Steps to Reproduce:

  1. Open the projects list in a new tab
  2. Click on any project that will have logs

Expected Behaviour

The first log's content should be loaded automatically.

Actual Behaviour

Log content does not autoload:
image

To load the first log, it must be triggered manually by clicking its tab.

Notes

Autoload can be triggered by refreshing the page, or opening the project in a new tab so that it starts with a clean slate.

This happens because the logs are initialised only when projects/all is empty (i.e. when loading the /projects page):

mounted() {
if (!this.$store.getters['projects/all'].length) {
this.$store.dispatch('projects/load').then(() => {
this.initLog();
});
}
},

If it doesn't break Vue it can probably be fixed by awaiting the projects/load action, and moving this.initLog() below the if statement.

ezoic increase your site revenue