Skip to content

Commit c58a839

Browse files
Do not cache settings.
1 parent fce328d commit c58a839

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

sdk/Notifo.SDK/Helpers/NotifoOptions.cs

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,22 @@ internal sealed class NotifoOptions : INotifoOptions
2222
.WaitAndRetryAsync(retryCount: 3, sleepDurationProvider: attempt => TimeSpan.FromMilliseconds(300));
2323

2424
private readonly ICredentialsStore store;
25-
private string? apiUrl = "https://cloud.squidex.io";
26-
private string? apiKey;
2725

2826
public bool IsConfigured
2927
{
30-
get => !string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(apiUrl);
28+
get => !string.IsNullOrEmpty(ApiKey) && !string.IsNullOrEmpty(ApiUrl);
3129
}
3230

3331
public string? ApiUrl
3432
{
35-
get => apiUrl;
36-
set
37-
{
38-
if (apiUrl != value)
39-
{
40-
apiUrl = value;
41-
store.ApiUrl = value;
42-
}
43-
}
33+
get => store.ApiUrl ?? "https://cloud.squidex.io";
34+
set => store.ApiUrl = value;
4435
}
4536

4637
public string? ApiKey
4738
{
48-
get => apiKey;
49-
set
50-
{
51-
if (apiKey != value)
52-
{
53-
apiKey = value;
54-
store.ApiKey = value;
55-
}
56-
}
39+
get => store.ApiKey;
40+
set => store.ApiKey = value;
5741
}
5842

5943
public string? ClientId => default;
@@ -65,9 +49,6 @@ public string? ApiKey
6549
public NotifoOptions(ICredentialsStore store)
6650
{
6751
this.store = store;
68-
69-
apiUrl = store.ApiUrl;
70-
apiKey = store.ApiKey;
7152
}
7253

7354
public void Validate()

0 commit comments

Comments
 (0)