Skip to content

Commit 710005c

Browse files
author
Jicheng Lu
committed
minor change
1 parent 4add20a commit 710005c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/routes/page/agent/reporting/[reportType]/+page.svelte

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
/** @type {any} */
1313
let menuUnsubscribe;
1414
15+
/** @type {string?} */
16+
let label = '';
17+
1518
/** @type {string} */
1619
let curSlug = '';
1720
@@ -27,12 +30,14 @@
2730
onMount(async () => {
2831
menuUnsubscribe = globalMenuStore.subscribe((/** @type {import('$pluginTypes').PluginMenuDefModel[]} */ menu) => {
2932
const url = getPathUrl();
30-
let data = menu.find(x => x.link === url)?.embeddingInfo || null;
31-
if (!data) {
32-
const found = menu.find(x => !!x.subMenu?.find(y => y.link === url));
33-
data = found?.subMenu?.find(x => x.link === url)?.embeddingInfo || null;
33+
let found = menu.find(x => x.link === url);
34+
label = found?.label || null;
35+
if (!found?.embeddingInfo) {
36+
const subFound = menu.find(x => !!x.subMenu?.find(y => y.link === url));
37+
found = subFound?.subMenu?.find(x => x.link === url);
38+
label = found?.label || null;
3439
}
35-
embed(data);
40+
embed(found?.embeddingInfo || null);
3641
});
3742
});
3843
@@ -79,8 +84,8 @@
7984
};
8085
</script>
8186
82-
<HeadTitle title="{$_('Reporting')}" />
83-
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_('Reporting')}" />
87+
<HeadTitle title="{$_(label || 'Reporting')}" />
88+
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_(label || 'Reporting')}" />
8489
8590
<Row>
8691
<Col lg="12">

0 commit comments

Comments
 (0)