Keep both apps and appstore views alive in vue to avoid frequent reloading
This commit is contained in:
@@ -354,10 +354,12 @@ onMounted(async () => {
|
||||
<Headerbar :config="config" :subscription="subscription"/>
|
||||
|
||||
<div style="display: flex; justify-content: center; overflow: auto; flex-grow: 1; padding: 0; margin: 0 10px; position: relative;">
|
||||
<AppsView v-if="view === VIEWS.APPS" />
|
||||
<AppConfigureView v-else-if="view === VIEWS.APP" />
|
||||
<KeepAlive>
|
||||
<AppsView v-if="view === VIEWS.APPS" />
|
||||
<AppstoreView v-else-if="view === VIEWS.APPSTORE" />
|
||||
</KeepAlive>
|
||||
<AppConfigureView v-if="view === VIEWS.APP" />
|
||||
<AppearanceView v-else-if="view === VIEWS.APPEARANCE" />
|
||||
<AppstoreView v-else-if="view === VIEWS.APPSTORE" />
|
||||
<BackupSitesView v-else-if="view === VIEWS.BACKUP_SITES" />
|
||||
<BackupListView v-else-if="view === VIEWS.BACKUP_LIST" />
|
||||
<BackupAppArchiveView v-else-if="view === VIEWS.BACKUP_APP_ARCHIVE" />
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { ref, computed, useTemplateRef, onMounted, onUnmounted, inject } from 'vue';
|
||||
import { ref, computed, useTemplateRef, onActivated, onMounted, onUnmounted, inject } from 'vue';
|
||||
import { Button, Menu, SingleSelect, Icon, TableView, TextInput, ProgressBar } from '@cloudron/pankow';
|
||||
import { API_ORIGIN, APP_TYPES, HSTATES, ISTATES, RSTATES } from '../constants.js';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
@@ -235,6 +235,10 @@ function toggleView() {
|
||||
localStorage.appsView = viewType.value;
|
||||
}
|
||||
|
||||
onActivated(async () => {
|
||||
await refreshApps();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await refreshApps();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import moment from 'moment';
|
||||
import { ref, computed, useTemplateRef, onMounted, onUnmounted, inject, watch, nextTick } from 'vue';
|
||||
import { ref, computed, useTemplateRef, onActivated, onMounted, onUnmounted, inject, watch, nextTick } from 'vue';
|
||||
import { TextInput, ProgressBar, InputDialog, SingleSelect } from '@cloudron/pankow';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
import AppstoreModel from '../models/AppstoreModel.js';
|
||||
@@ -178,6 +178,10 @@ function setItemWidth() {
|
||||
else itemWidth.value = Number((width-gap*4)/4).toFixed() + 'px';
|
||||
}
|
||||
|
||||
onActivated(async () => {
|
||||
await getInstalledApps();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await getInstalledApps();
|
||||
await getAppList();
|
||||
|
||||
Reference in New Issue
Block a user