Merge pull request 'fix(StandardMenu): appLimit must return a value > 0' (#412) from develop into master
Some checks are pending
ci/woodpecker/push/build Pipeline is pending approval
ci/woodpecker/push/security Pipeline is pending approval
ci/woodpecker/tag/build Pipeline was successful
ci/woodpecker/tag/security Pipeline was successful
ci/woodpecker/tag/publish Pipeline was successful

Reviewed-on: #412
This commit is contained in:
Simon Vieille 2025-04-17 00:05:38 +02:00
commit 12604b44fc
3 changed files with 12 additions and 6 deletions

View file

@ -1,5 +1,9 @@
## [Unreleased]
## 5.0.1
### Fixed
* fix(StandardMenu): appLimit must return a value > 0
## 5.0.0
### Fixed
* fix apps's order in the standard menu

View file

@ -30,7 +30,7 @@ Notice
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**.
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
]]></description>
<version>5.0.0</version>
<version>5.0.1</version>
<licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
<namespace>SideMenu</namespace>

View file

@ -142,7 +142,7 @@ const appLimit = () => {
})
}
return Math.floor((body.offsetWidth - size) / 70)
return Math.max(0, Math.floor((body.offsetWidth - size) / 70))
}
const makeStyle = (app) => {
@ -158,6 +158,11 @@ const computeLists = () => {
popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order)
}
const reComputeLists = (delay) => {
window.clearTimeout(resizeTimeout)
resizeTimeout = window.setTimeout(computeLists, delay || 100)
}
onMounted(async () => {
const config = await configStore.getConfig()
@ -169,10 +174,7 @@ onMounted(async () => {
setApps(await navStore.getCoreApps())
window.addEventListener('resize', () => {
window.clearTimeout(resizeTimeout)
resizeTimeout = window.setTimeout(computeLists, 100)
})
window.addEventListener('resize', reComputeLists)
})
</script>