Skip to content

Commit 9a0a494

Browse files
committed
fix: missing "Once" changes, rollback to "On" on Notification
1 parent adc1e81 commit 9a0a494

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ElectronNET.API/API/AutoUpdater.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public Task<SemVer> CurrentVersionAsync
168168
{
169169
var tcs = new TaskCompletionSource<SemVer>();
170170

171-
BridgeConnector.Socket.On<SemVer>("autoUpdater-currentVersion-get-reply", tcs.SetResult);
171+
BridgeConnector.Socket.Once<SemVer>("autoUpdater-currentVersion-get-reply", tcs.SetResult);
172172
BridgeConnector.Socket.Emit("autoUpdater-currentVersion-get");
173173

174174
return tcs.Task;
@@ -201,7 +201,7 @@ public Task<string> ChannelAsync
201201
{
202202
var tcs = new TaskCompletionSource<string>();
203203

204-
BridgeConnector.Socket.On<string>("autoUpdater-channel-get-reply", tcs.SetResult);
204+
BridgeConnector.Socket.Once<string>("autoUpdater-channel-get-reply", tcs.SetResult);
205205
BridgeConnector.Socket.Emit("autoUpdater-channel-get");
206206

207207
return tcs.Task;
@@ -221,7 +221,7 @@ public Task<Dictionary<string, string>> RequestHeadersAsync
221221
{
222222
var tcs = new TaskCompletionSource<Dictionary<string, string>>();
223223

224-
BridgeConnector.Socket.On<Dictionary<string, string>>("autoUpdater-requestHeaders-get-reply", tcs.SetResult);
224+
BridgeConnector.Socket.Once<Dictionary<string, string>>("autoUpdater-requestHeaders-get-reply", tcs.SetResult);
225225
BridgeConnector.Socket.Emit("autoUpdater-requestHeaders-get");
226226

227227
return tcs.Task;
@@ -441,7 +441,7 @@ public Task<string> GetFeedURLAsync()
441441
var tcs = new TaskCompletionSource<string>();
442442
string guid = Guid.NewGuid().ToString();
443443

444-
BridgeConnector.Socket.On<string>("autoUpdaterGetFeedURLComplete" + guid, tcs.SetResult);
444+
BridgeConnector.Socket.Once<string>("autoUpdaterGetFeedURLComplete" + guid, tcs.SetResult);
445445
BridgeConnector.Socket.Emit("autoUpdaterGetFeedURL", guid);
446446

447447
return tcs.Task;

src/ElectronNET.API/API/Notification.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static void GenerateIDsForDefinedActions(NotificationOptions notificatio
6262
isActionDefined = true;
6363

6464
BridgeConnector.Socket.Off("NotificationEventShow");
65-
BridgeConnector.Socket.Once<string>("NotificationEventShow", (id) => { _notificationOptions.Single(x => x.ShowID == id).OnShow(); });
65+
BridgeConnector.Socket.On<string>("NotificationEventShow", (id) => { _notificationOptions.Single(x => x.ShowID == id).OnShow(); });
6666
}
6767

6868
if (notificationOptions.OnClick != null)

0 commit comments

Comments
 (0)