Speed up app install dialog opening by not refetching domain list

This commit is contained in:
Johannes Zellner
2025-09-30 12:04:58 +02:00
parent d4262e9fdc
commit 56c2b8798c
2 changed files with 15 additions and 8 deletions
+13 -1
View File
@@ -9,15 +9,18 @@ import { ref, computed, useTemplateRef, onActivated, onDeactivated, inject, watc
import { TextInput, ProgressBar, InputDialog, SingleSelect } from '@cloudron/pankow';
import AppsModel from '../models/AppsModel.js';
import AppstoreModel from '../models/AppstoreModel.js';
import DomainsModel from '../models/DomainsModel.js';
import AppInstallDialog from '../components/AppInstallDialog.vue';
import AppStoreItem from '../components/AppStoreItem.vue';
const appsModel = AppsModel.create();
const appstoreModel = AppstoreModel.create();
const domainsModel = DomainsModel.create();
const ready = ref(false);
const apps = ref([]);
const search = ref('');
const domains = ref([]);
// clear category on search
watch(search, (newValue) => {
@@ -151,7 +154,7 @@ async function onHashChange() {
const app = await getApp(appId, version);
if (app) {
appInstallDialog.value.open(app, installedApps.value.length >= features.value.appMaxCount);
appInstallDialog.value.open(app, installedApps.value.length >= features.value.appMaxCount, domains.value);
} else {
inputDialog.value.info({
title: t('appstore.appNotFoundDialog.title'),
@@ -178,11 +181,20 @@ function setItemWidth() {
else itemWidth.value = Number((width-gap*4)/4).toFixed() + 'px';
}
async function getDomains() {
const [error, result] = await domainsModel.list();
if (error) return console.error(error);
domains.value = result;
}
onActivated(async () => {
setItemWidth();
await getAppList();
ready.value = true;
await getDomains();
await getInstalledApps();
// only deals with #/appstore/ hashes