Skip to content

Commit

Permalink
Fix compile warning
Browse files Browse the repository at this point in the history
  • Loading branch information
CorruptComputer authored and corp-0 committed Mar 9, 2023
1 parent f9ea4b9 commit 308618b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions UnitystationLauncher/ViewModels/NewsPanelViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class NewsPanelViewModel : PanelBase

public override bool IsEnabled => true;

private ViewModelBase _currentBlogPost;
private ViewModelBase? _currentBlogPost;
private ViewModelBase CurrentBlogPost
{
get => _currentBlogPost;
get => _currentBlogPost ?? new BlogPostViewModel("Loading...", string.Empty, null);
set => this.RaiseAndSetIfChanged(ref _currentBlogPost, value);
}

Expand All @@ -37,8 +37,6 @@ public ViewModelBase Changelog
public ReactiveCommand<Unit, Unit> PreviousBlog { get; }
private int CurrentBlogPostIndex { get; set; }



public NewsPanelViewModel(ChangelogViewModel changelog)
{
_changelog = changelog;
Expand All @@ -53,7 +51,6 @@ public NewsPanelViewModel(ChangelogViewModel changelog)
FetchBlogPosts();
NextBlog = ReactiveCommand.Create(NextPost);
PreviousBlog = ReactiveCommand.Create(PreviousPost);
CurrentBlogPost = new BlogPostViewModel("Loading...", string.Empty, null);
CurrentBlogPostIndex = 0;

SetCurrentBlogPost();
Expand Down

0 comments on commit 308618b

Please sign in to comment.