Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.0 #13

Merged
merged 5 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions src/MailLobbyer/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/MailLobbyer/obj/Host/node_modules/electron/dist/electron filter=lfs diff=lfs merge=lfs -text
10 changes: 0 additions & 10 deletions src/MailLobbyer/Hubs/CSVHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@ public async Task CSVFileSeeker()
if (!Directory.Exists(directorypath))
{
Directory.CreateDirectory(directorypath);
System.Console.WriteLine("CSV contact-grouping directory created successfully.");
}

else
{
System.Console.WriteLine("CSV contact-grouping directory already exists.");
}

// Later on change to use config values set by the user
filepaths = Directory.GetFiles(directorypath);

foreach (string filepath in filepaths)
{

using (var ms = new MemoryStream())
{
using(FileStream fs = new FileStream(filepath, FileMode.Open,FileAccess.Read))
Expand Down Expand Up @@ -66,11 +59,8 @@ public async Task RemoveCSVFile(string selectedcsvfilename)
File.Delete(filepath);
}
}

}



public async Task<List<CSVFile>> GetCSVFilesInMemory()
{
return csvfilesinmemory;
Expand Down
1 change: 1 addition & 0 deletions src/MailLobbyer/Hubs/EmailHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ await Task.Run(async () =>
{
// If 20 emails are sent, wait 5 minutes.
await Task.Delay(300000);
sentemails = 0;
}

string prefixsyntax = "/P";
Expand Down
13 changes: 8 additions & 5 deletions src/MailLobbyer/MailLobbyer.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MailKit" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="ElectronNET.API" Version="23.6.2" />
</ItemGroup>

</Project>
<ItemGroup>
<Content Update="electron.manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/MailLobbyer/Pages/Email.razor
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@

if (settingshubconnection is not null)
{
await csvhubconnection.SendAsync("SettingsProfilesSeeker");
await settingshubconnection.SendAsync("SettingsProfilesSeeker");

// Replace with profiles reading when implemented.
// await csvhubconnection.SendAsync("CSVFileSeeker");
Expand Down Expand Up @@ -233,7 +233,7 @@

private async Task EmailFormSubmitHandler()
{
if (selectedcsvfileid == null)
if (selectedcsvfileid == Guid.Empty)
{
// Replace with popup!
Console.WriteLine("Please select a group.");
Expand Down
14 changes: 13 additions & 1 deletion src/MailLobbyer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
using MailLobbyer.CSVFileClass;
using Microsoft.AspNetCore.ResponseCompression;
using MailLobbyer.Server.Hubs;
using ElectronNET.API;
using ElectronNET.API.Entities;

var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseElectron(args);

// Add services to the container.
builder.Services.AddRazorPages();
Expand All @@ -17,6 +20,8 @@
new[] { "application/octet-stream" });
});

builder.Services.AddElectron();

var app = builder.Build();

// Configure the HTTP request pipeline.
Expand All @@ -41,6 +46,13 @@
app.MapFallbackToPage("/_Host");


app.Run();
await app.StartAsync();

var electronBrowserWindowOptions = new BrowserWindowOptions {AutoHideMenuBar = true};
await Electron.WindowManager.CreateWindowAsync(electronBrowserWindowOptions);


app.WaitForShutdown();



7 changes: 7 additions & 0 deletions src/MailLobbyer/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
}
},
"profiles": {
"Electron.NET App": {
"commandName": "Executable",
"executablePath": "electronize",
"commandLineArgs": "start",
"workingDirectory": "."
},

"http": {
"commandName": "Project",
"dotnetRunMessages": true,
Expand Down
Binary file removed src/MailLobbyer/bin/Debug/net7.0/MailLobbyer
Binary file not shown.
Loading