Skip to content

Commit 669970a

Browse files
committed
Added ability to add the wildlife apps to a newly created profile.
1 parent 7f4014e commit 669970a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

WolfLeash/Components/Pages/Profiles/SubComponent/AddProfile.razor

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@inject ILogger<AddProfile> Logger
55
@inject Api Api
66
@inject EventLogger Event
7+
@inject DefaultAppLoader WildLifeApps
78

89
@if(Directory.Exists("/etc/wolf/covers"))
910
{
@@ -40,6 +41,13 @@
4041
}
4142
</div>
4243

44+
<div class="form-group row mb-3">
45+
<div style="display:flex; flex-direction: row; justify-content: left; align-items: center">
46+
<a>Include Default Apps:</a>
47+
<InputCheckbox @bind-Value="_addDefaultApps"/>
48+
</div>
49+
</div>
50+
4351
<div class="form-group row mb-3">
4452
<div style="display:flex; flex-direction: row; justify-content: left; align-items: center">
4553
<a>Enable Pin:</a>
@@ -84,6 +92,7 @@
8492
private EditContext? _editContext;
8593

8694
private bool _showPinInput = false;
95+
private bool _addDefaultApps = false;
8796

8897
protected override void OnInitialized()
8998
{
@@ -109,7 +118,7 @@
109118
Id = Guid.NewGuid().ToBase64(),
110119
Icon_png_path = Data!.IconPngPath,
111120
Pin = _showPinInput ? Data!.Pin : null,
112-
Apps = Array.Empty<GamesOnWhales.App>()
121+
Apps = _addDefaultApps ? await WildLifeApps.GetApps() : Array.Empty<GamesOnWhales.App>()
113122
};
114123

115124
await Api.AddProfile(newProfile);

0 commit comments

Comments
 (0)