调整 UIRouter 的打开关闭 UI 的返回值,统一成 UniTask
This commit is contained in:
@@ -218,27 +218,27 @@ namespace SepCore.UI
|
||||
return await OpenFormAsync(context, timeout);
|
||||
}
|
||||
|
||||
public override async UniTask<int?> OpenUIAsync(object userData = null, float timeout = 30f)
|
||||
public override async UniTask OpenUIAsync(object userData = null, float timeout = 30f)
|
||||
{
|
||||
if (userData is ShopRawData rawData)
|
||||
{
|
||||
return await OpenUIAsync(rawData, timeout);
|
||||
await OpenUIAsync(rawData, timeout);
|
||||
}
|
||||
|
||||
if (userData != null)
|
||||
{
|
||||
Log.Warning("ShopController.OpenUIAsync() userData type is invalid.");
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_useCase == null)
|
||||
{
|
||||
Log.Error("ShopController.OpenUIAsync() useCase is null.");
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
ShopRawData initialRawData = _useCase.CreateInitialModel();
|
||||
return await OpenUIAsync(initialRawData, timeout);
|
||||
await OpenUIAsync(initialRawData, timeout);
|
||||
}
|
||||
|
||||
public override void BindUseCase(IUIUseCase useCase)
|
||||
@@ -272,7 +272,8 @@ namespace SepCore.UI
|
||||
|
||||
for (int i = 0; i < result.GoodsItems.Count; i++)
|
||||
{
|
||||
if (i < Context.GoodsItems.Count) Context.GoodsItems[i] = await GoodsItemContext.CreateAsync(result.GoodsItems[i]);
|
||||
if (i < Context.GoodsItems.Count)
|
||||
Context.GoodsItems[i] = await GoodsItemContext.CreateAsync(result.GoodsItems[i]);
|
||||
else Context.GoodsItems.Add(await GoodsItemContext.CreateAsync(result.GoodsItems[i]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user