little fix

This commit is contained in:
MyDrift 2024-08-20 20:53:00 +02:00
parent c914a7bc79
commit 210d288035

View File

@ -45,13 +45,6 @@ function Invoke-WPFUIElements {
$targetGrid.ColumnDefinitions.Add($colDef) | Out-Null
}
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
if ($targetGridName -eq "appspanel") {
$panelcount = 0
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
}
# Convert PSCustomObject to Hashtable
$configHashtable = @{}
$configVariable.PSObject.Properties.Name | ForEach-Object {
@ -90,6 +83,13 @@ function Invoke-WPFUIElements {
# Store application data in an array under the category
$organizedData[$entryObject.Panel][$entryObject.Category] += $entryObject
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
if ($targetGridName -eq "appspanel") {
$panelcount = 0
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
}
}
# Iterate through 'organizedData' by panel, category, and application