fix: resolve NPM access list name on page load instead of showing ID
This commit is contained in:
@@ -168,6 +168,15 @@
|
|||||||
} catch { sslCertName = `Certificate #${sslCertificateId}`; }
|
} catch { sslCertName = `Certificate #${sslCertificateId}`; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function resolveAccessListName() {
|
||||||
|
if (accessListId <= 0) return;
|
||||||
|
try {
|
||||||
|
const lists = await listNpmAccessLists();
|
||||||
|
const match = lists.find((al) => al.id === accessListId);
|
||||||
|
accessListName = match ? match.name : `Access List #${accessListId}`;
|
||||||
|
} catch { accessListName = `Access List #${accessListId}`; }
|
||||||
|
}
|
||||||
|
|
||||||
async function handleNpmRemoteChange() {
|
async function handleNpmRemoteChange() {
|
||||||
try {
|
try {
|
||||||
await updateSettings({ npm_remote: npmRemote } as any);
|
await updateSettings({ npm_remote: npmRemote } as any);
|
||||||
@@ -179,7 +188,7 @@
|
|||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
await loadData();
|
await loadData();
|
||||||
await resolveCertName();
|
await Promise.all([resolveCertName(), resolveAccessListName()]);
|
||||||
}
|
}
|
||||||
$effect(() => { init(); });
|
$effect(() => { init(); });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user