WerksverkaufScanner: InventurScan fixed, Benachrichtigung keine Config

This commit is contained in:
Christopher Meinhold 2025-12-01 14:16:48 +01:00
parent d7a90eef92
commit abf6997901

View File

@ -108,26 +108,43 @@ else
// JS-Interop nur after first render (sonst Prerender-Fehler)
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await LoadConfigAsync();
// Erst fokussieren, wenn Setup ok
if (!needsSetup && focusBarcode)
var s = firstRender.ToString();
try
{
var f = await JS.InvokeAsync<string?>("localStorage.getItem", "scannerpilot.filialId");
var i = await JS.InvokeAsync<string?>("localStorage.getItem", "scannerpilot.inventurId");
if (!String.IsNullOrWhiteSpace(f) || !String.IsNullOrWhiteSpace(i))
{
focusBarcode = false;
await barcodeRef.FocusAsync();
await LoadConfigAsync();
if (focusBarcode)
{
focusBarcode = false;
await barcodeRef.FocusAsync();
}
if (focusMenge)
{
focusMenge = false;
await mengeRef.FocusAsync();
}
}
else
{
needsSetup = true;
}
StateHasChanged(); // UI nach Konfig-Check aktualisieren
return;
}
catch
{
needsSetup = true;
filialId = null;
inventurId = null;
}
if (!needsSetup && focusMenge)
{
focusMenge = false;
await mengeRef.FocusAsync();
}
}
private async Task LoadConfigAsync()