fix intro UI not showing secret key after registration, fix file system watchers not starting automatically initially

This commit is contained in:
Stanley Dimant
2022-07-10 20:23:02 +02:00
parent 77d3828f86
commit d338b4b93c
5 changed files with 11 additions and 7 deletions

View File

@@ -91,7 +91,7 @@ namespace MareSynchronos.Managers
public void StartWatchers()
{
if (!_ipcManager.Initialized || !_pluginConfiguration.HasValidSetup()) return;
if (!_ipcManager.Initialized || string.IsNullOrEmpty(_pluginConfiguration.CacheFolder)) return;
Logger.Verbose("Starting File System Watchers");
_penumbraDirWatcher?.Dispose();
_cacheDirWatcher?.Dispose();

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<Authors></Authors>
<Company></Company>
<Version>0.1.7.0</Version>
<Version>0.1.8.0</Version>
<Description></Description>
<Copyright></Copyright>
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>

View File

@@ -176,7 +176,7 @@ namespace MareSynchronos.UI
"Make a backup of your secret key. In case of loss, it cannot be restored. The secret key is your identification to the service " +
"to verify who you are. It is directly tied to the UID you will be receiving. In case of loss, you will have to re-register an account.", ImGuiColors.DalamudRed);
UiShared.ColorTextWrapped("Do not ever, under any circumstances, share your secret key to anyone! Likewise do not share your Mare Synchronos plugin configuration to anyone!", ImGuiColors.DalamudRed);
_uiShared.DrawServiceSelection(() => SwitchToMainUi?.Invoke(), true);
_uiShared.DrawServiceSelection(new Action(() => { }), true);
}
}
}

View File

@@ -318,7 +318,7 @@ namespace MareSynchronos.UI
{
_pluginConfiguration.FullPause = false;
_pluginConfiguration.Save();
Task.Run(_apiController.Register);
Task.Run(() => _apiController.Register(isIntroUi));
ShowClientSecret = true;
callBackOnExit?.Invoke();
}
@@ -345,7 +345,7 @@ namespace MareSynchronos.UI
if (_enterSecretKey)
{
ColorTextWrapped("This will overwrite your currently used secret key for the selected service. Make sure to have a backup for the current secret key if you want to switch back to this acocunt.", ImGuiColors.DalamudYellow);
ColorTextWrapped("This will overwrite your currently used secret key for the selected service. Make sure to have a backup for the current secret key if you want to switch back to this account.", ImGuiColors.DalamudYellow);
ImGui.SetNextItemWidth(400);
ImGui.InputText("Enter Secret Key", ref _secretKey, 255);
ImGui.SameLine();

View File

@@ -18,14 +18,18 @@ namespace MareSynchronos.WebAPI
await CreateConnections();
}
public async Task Register()
public async Task Register(bool isIntroUi = false)
{
if (!ServerAlive) return;
Logger.Debug("Registering at service " + ApiUri);
var response = await _userHub!.InvokeAsync<string>(UserHubAPI.InvokeRegister);
_pluginConfiguration.ClientSecret[ApiUri] = response;
_pluginConfiguration.Save();
RegisterFinalized?.Invoke();
if (!isIntroUi)
{
RegisterFinalized?.Invoke();
}
await CreateConnections();
}