Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reverted change in UserWidget class
  • Loading branch information
Felipe da Conceicao Guimaraes
Felipe da Conceicao Guimaraes committed Aug 28, 2024
commit bfb2a48ec0ac386c3d168b9571376f717ffe282e
37 changes: 16 additions & 21 deletions src/GitHubExtension/Widgets/GitHubUserWidget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,33 +135,28 @@ public override void OnCustomizationRequested(WidgetCustomizationRequestedArgs c
base.OnCustomizationRequested(customizationRequestedArgs);
}

protected void SubmitAction(string data)
public override void OnActionInvoked(WidgetActionInvokedArgs actionInvokedArgs)
{
var dataObject = JsonNode.Parse(data);

if (dataObject == null)
if (actionInvokedArgs.Verb == "Submit")
{
return;
}
var data = actionInvokedArgs.Data;
var dataObject = JsonNode.Parse(data);

ShowCategory = EnumHelper.StringToSearchCategory(dataObject["showCategory"]?.GetValue<string>() ?? string.Empty);
DeveloperLoginId = dataObject["account"]?.GetValue<string>() ?? string.Empty;
UpdateTitle(dataObject);
if (dataObject == null)
{
return;
}

ConfigurationData = data;
ShowCategory = EnumHelper.StringToSearchCategory(dataObject["showCategory"]?.GetValue<string>() ?? string.Empty);
DeveloperLoginId = dataObject["account"]?.GetValue<string>() ?? string.Empty;
UpdateTitle(dataObject);

// If we got here during the customization flow, we need to LoadContentData again
// so we can show the loading page rather than stale data.
LoadContentData();
UpdateActivityState();
}
ConfigurationData = data;

public override void OnActionInvoked(WidgetActionInvokedArgs actionInvokedArgs)
{
if (actionInvokedArgs.Verb == "Submit")
{
var data = actionInvokedArgs.Data;
SubmitAction(data);
// If we got here during the customization flow, we need to LoadContentData again
// so we can show the loading page rather than stale data.
LoadContentData();
UpdateActivityState();
}
else
{
Expand Down