Skip to content

Commit

Permalink
use CopyData function on either domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Jun 19, 2024
1 parent ed6ace1 commit 9f08bcd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Pages/AccountView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ else if (appData?.FamilyData == null)
{
refreshButtonText = "Updating...";
refreshButtonDisabled = true;
string domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
var domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
await appData.FamilyData!.RefreshPrices(Http, domain);
await appData.FamilyData!.UpdateStatsAsync();
await ProfileUtilities.Save(appData.CurrentProfileName, appData.FamilyData);
Expand Down
2 changes: 1 addition & 1 deletion Pages/Portfolio.razor
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ else if (appData is not null && appData.FamilyData is not null)
refreshButtonDisabled = true;
if (appData?.FamilyData != null)
{
string domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
var domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
await appData.FamilyData.RefreshPrices(Http, domain);
await appData.FamilyData.UpdateStatsAsync();
await ProfileUtilities.Save(appData.CurrentProfileName, appData.FamilyData);
Expand Down
8 changes: 5 additions & 3 deletions Pages/Profiles.razor
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@
{
var jsonEncoding = "{ 'copyCode':'"+copyCode?.Trim()+"'}";
var myHttpContent = new MyHttpContent(jsonEncoding);
var familyDataResponse = await Http.PostAsync($"https://api.bogle.tools/api/copydata", myHttpContent, CancellationToken.None);
var domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
var familyDataResponse = await Http.PostAsync($"https://api.{domain}/api/copydata", myHttpContent, CancellationToken.None);
await ProfileUtilities.Save(newProfileName, await familyDataResponse.Content.ReadAsStringAsync());
if (appData.CurrentProfileName == newProfileName)
{
Expand Down Expand Up @@ -204,9 +205,10 @@
var profileData = await ProfileUtilities.GetProfileData(profileName);
var jsonEncoding = "{ \"profileData\":'"+profileData+"'}";
var myHttpContent = new MyHttpContent(jsonEncoding);
var securityKeyResponse = await Http.PostAsync($"https://api.bogle.tools/api/copydata", myHttpContent, CancellationToken.None);
var domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
var securityKeyResponse = await Http.PostAsync($"https://api.{domain}/api/copydata", myHttpContent, CancellationToken.None);
var copyToCode = await securityKeyResponse.Content.ReadAsStringAsync();
log += $"\n{profileName} profile shared. Navigate any device to https://bogle.tools/copyFrom/{copyToCode} within 5 minutes.\n";
log += $"\n{profileName} profile shared. Navigate any device to https://{domain}/copyFrom/{copyToCode} within 5 minutes.\n";
}

private async Task deleteProfile(EventArgs e, string profileName)
Expand Down
2 changes: 1 addition & 1 deletion Pages/RSU-Tracker.razor
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@

private async Task refreshPrices() {
refreshButtonText = "Updating...";
string domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
var domain = (new Uri(Navigation.Uri).Host == "bogle.tools") ? "bogle.tools" : "multifol.io";
await appData.FamilyData!.RefreshPrices(Http, domain);
await appData.FamilyData.UpdateStatsAsync();
await ProfileUtilities.Save(appData.CurrentProfileName, appData.FamilyData);
Expand Down
2 changes: 1 addition & 1 deletion api/CopyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("SearchTicker processed a request.");
log.LogInformation("CopyData processed a request.");

string copyCode = req.Query["copyCode"];
string profileData = req.Query["profileData"];
Expand Down

0 comments on commit 9f08bcd

Please sign in to comment.