-
+
+
+
+
+
-
-
-
-
An error occured while loading a page
-
-
-
- @if (!string.IsNullOrWhiteSpace(ErrorMessage))
- {
-
- }
+
+
+
+
An error occured while loading a page
+
+
+
+ @if (!string.IsNullOrWhiteSpace(ErrorMessage))
+ {
+
+ }
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor
index ea3d99a..a57afcc 100644
--- a/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor
+++ b/WatchIt.Website/WatchIt.Website/Components/LoadingComponent.razor
@@ -1,12 +1,8 @@
-
-
-
+
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
index b816a89..24e27be 100644
--- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
+++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor
@@ -56,7 +56,7 @@
}
diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs
index feeecbe..9485fc0 100644
--- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs
+++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs
@@ -28,6 +28,8 @@ public partial class MainLayout : LayoutComponentBase
#region FIELDS
private bool _loaded = false;
+
+ private PhotoResponse? _defaultBackgroundPhoto;
private User? _user = null;
private AccountProfilePictureResponse? _userProfilePicture;
@@ -39,8 +41,17 @@ public partial class MainLayout : LayoutComponentBase
#region PROPERTIES
-
- public PhotoResponse? BackgroundPhoto { get; set; }
+
+ private PhotoResponse? _backgroundPhoto;
+ public PhotoResponse? BackgroundPhoto
+ {
+ get => _backgroundPhoto;
+ set
+ {
+ _backgroundPhoto = value;
+ StateHasChanged();
+ }
+ }
#endregion
@@ -64,7 +75,7 @@ public partial class MainLayout : LayoutComponentBase
]);
endTasks.AddRange(
[
- PhotosWebAPIService.GetPhotoRandomBackground(data => BackgroundPhoto = data)
+ PhotosWebAPIService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data)
]);
// STEP 1
@@ -84,6 +95,19 @@ public partial class MainLayout : LayoutComponentBase
StateHasChanged();
}
}
+
+ private PhotoResponse? GetBackgroundPhoto()
+ {
+ if (BackgroundPhoto?.Background is not null)
+ {
+ return BackgroundPhoto;
+ }
+ else if (_defaultBackgroundPhoto?.Background is not null)
+ {
+ return _defaultBackgroundPhoto;
+ }
+ return null;
+ }
#endregion
diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor
index fed8def..8946ac8 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor
+++ b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor
@@ -26,11 +26,19 @@
}
else
{
-
+
}
}
else
{
-
+
}
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs
index 2a9306a..3817611 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs
+++ b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs
@@ -1,15 +1,24 @@
using Microsoft.AspNetCore.Components;
+using WatchIt.Website.Layout;
using WatchIt.Website.Services.Utility.Authentication;
namespace WatchIt.Website.Pages;
public partial class AdminPage
{
- #region SERVICE
+ #region SERVICES
[Inject] public IAuthenticationService AuthenticationService { get; set; } = default!;
#endregion
+
+
+
+ #region PARAMETERS
+
+ [CascadingParameter] public MainLayout Layout { get; set; }
+
+ #endregion
@@ -28,6 +37,8 @@ public partial class AdminPage
{
if (firstRender)
{
+ Layout.BackgroundPhoto = null;
+
User? user = await AuthenticationService.GetUserAsync();
if (user is not null && user.IsAdmin)
{
diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor
index 2d99b94..0e9cc89 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor
+++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor
@@ -87,11 +87,19 @@
}
else
{
-
+
}
}
else
{
-
+
}
\ No newline at end of file
diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs
index 706a9c6..5f528db 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs
+++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs
@@ -2,6 +2,7 @@
using WatchIt.Common.Model.Media;
using WatchIt.Common.Model.Movies;
using WatchIt.Common.Model.Series;
+using WatchIt.Website.Layout;
using WatchIt.Website.Services.WebAPI.Media;
using WatchIt.Website.Services.WebAPI.Movies;
using WatchIt.Website.Services.WebAPI.Series;
@@ -21,6 +22,14 @@ public partial class HomePage
+ #region PARAMETERS
+
+ [CascadingParameter] public MainLayout Layout { get; set; }
+
+ #endregion
+
+
+
#region FIELDS
private bool _loaded;
@@ -39,6 +48,8 @@ public partial class HomePage
{
if (firstRender)
{
+ Layout.BackgroundPhoto = null;
+
List
step1Tasks = new List();
List endTasks = new List();
diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor
index 616d826..bcfcac0 100644
--- a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor
+++ b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor
@@ -362,31 +362,28 @@
}
else
{
-
+
}
}
else
{
-
+
}
}
else
{
-
+
}
-