cleanup, actually show success/failure
This commit is contained in:
@@ -106,7 +106,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
public IDictionary<UserData, List<CharaDataMetaInfoExtendedDto>> SharedWithYouData => _sharedWithYouData;
|
||||
public Task? UiBlockingComputation { get; private set; }
|
||||
public ValueProgress<string>? UploadProgress { get; private set; }
|
||||
public Task<(string Output, bool Success)>? UploadTask { get; private set; }
|
||||
public Task<(string Output, bool Success)>? UploadTask { get; set; }
|
||||
public bool BrioAvailable => _ipcManager.Brio.APIAvailable;
|
||||
|
||||
public Task ApplyCharaData(CharaDataDownloadDto dataDownloadDto, string charaName)
|
||||
@@ -631,6 +631,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
{
|
||||
_ownCharaData.Remove(dto.Id);
|
||||
_metaInfoCache.Remove(dto.FullId, out _);
|
||||
UiBlockingComputation = null;
|
||||
return ("No such DTO found", false);
|
||||
}
|
||||
|
||||
@@ -639,11 +640,12 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
|
||||
if (!extendedDto!.HasMissingFiles)
|
||||
{
|
||||
UiBlockingComputation = null;
|
||||
return ("Restored successfully", true);
|
||||
}
|
||||
|
||||
var missingFileList = extendedDto!.MissingFiles.ToList();
|
||||
return await UploadFiles(missingFileList, async () =>
|
||||
var result = await UploadFiles(missingFileList, async () =>
|
||||
{
|
||||
var newFilePaths = dto.FileGamePaths;
|
||||
foreach (var missing in missingFileList)
|
||||
@@ -657,6 +659,9 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
var res = await _apiController.CharaDataUpdate(updateDto).ConfigureAwait(false);
|
||||
await AddOrUpdateDto(res).ConfigureAwait(false);
|
||||
}).ConfigureAwait(false);
|
||||
|
||||
UiBlockingComputation = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void ApplyDataToSelf(CharaDataFullExtendedDto dataDto)
|
||||
@@ -987,8 +992,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
||||
}
|
||||
finally
|
||||
{
|
||||
UploadTask = null;
|
||||
UploadProgress = null;
|
||||
UiBlockingComputation = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user