Fix account persistence edge case
This commit is contained in:
parent
dd25792864
commit
dd3b032b21
@ -91,5 +91,7 @@ namespace InternalUtilities
|
||||
ArgumentValidator.EnsureNotNullOrWhiteSpace(accountId, nameof(accountId));
|
||||
AccountId = accountId.Trim();
|
||||
}
|
||||
|
||||
public override string ToString() => $"{AccountId} - {Locale?.Name ?? "[empty]"}";
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +113,9 @@ namespace InternalUtilities
|
||||
return false;
|
||||
|
||||
account.Updated -= update;
|
||||
return _accounts_backing.Remove(account);
|
||||
var result = _accounts_backing.Remove(account);
|
||||
update_no_validate();
|
||||
return result;
|
||||
}
|
||||
|
||||
private void validate(Account account)
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
|
||||
<Version>3.1.12.271</Version>
|
||||
<Version>3.1.12.279</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -8,6 +8,7 @@ using Dinah.Core;
|
||||
using Dinah.Core.Drawing;
|
||||
using Dinah.Core.Windows.Forms;
|
||||
using FileManager;
|
||||
using InternalUtilities;
|
||||
using LibationWinForms.Dialogs;
|
||||
|
||||
namespace LibationWinForms
|
||||
@ -42,6 +43,8 @@ namespace LibationWinForms
|
||||
PictureStorage.SetDefaultImage(PictureSize._300x300, Properties.Resources.default_cover_300x300.ToBytes(format));
|
||||
PictureStorage.SetDefaultImage(PictureSize._500x500, Properties.Resources.default_cover_500x500.ToBytes(format));
|
||||
|
||||
setImportMenu();
|
||||
|
||||
setVisibleCount(null, 0);
|
||||
|
||||
reloadGrid();
|
||||
@ -225,7 +228,16 @@ namespace LibationWinForms
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region index menu
|
||||
#region Import menu
|
||||
private void setImportMenu()
|
||||
{
|
||||
var hasMultipleAccounts = AudibleApiStorage.GetPersistentAccountsSettings().Accounts.Count > 1;
|
||||
|
||||
scanLibraryToolStripMenuItem.Visible = !hasMultipleAccounts;
|
||||
scanLibraryOfAllAccountsToolStripMenuItem.Visible = hasMultipleAccounts;
|
||||
scanLibraryOfSomeAccountsToolStripMenuItem.Visible = hasMultipleAccounts;
|
||||
}
|
||||
|
||||
private void scanLibraryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using var dialog = new IndexLibraryDialog();
|
||||
@ -309,7 +321,10 @@ private void scanLibraryOfSomeAccountsToolStripMenuItem_Click(object sender, Eve
|
||||
|
||||
#region settings menu
|
||||
private void accountsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
=> new AccountsDialog().ShowDialog();
|
||||
{
|
||||
new AccountsDialog().ShowDialog();
|
||||
setImportMenu();
|
||||
}
|
||||
|
||||
private void basicSettingsToolStripMenuItem_Click(object sender, EventArgs e) => new SettingsDialog().ShowDialog();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user