Skip to content

Commit 29eada6

Browse files
committed
Fix nullable reference type warnings
1 parent adcf04e commit 29eada6

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

src/Bible.Alarm/Platforms/Android/Services/UI/NotificationService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace Bible.Alarm.Platforms.Android.Services.UI;
2020

21-
public class DroidNotificationService(ILogger logger, IStorageService storageService) : INotificationService
21+
public class DroidNotificationService(ILogger logger, IStorageService _) : INotificationService
2222
{
2323
public static readonly string ChannelIdAndName = "alarm_notification";
2424
public static readonly string ChannelDescription = "alarm_notification are send to this channel";
@@ -186,7 +186,7 @@ private bool IsAndroidService()
186186

187187
public void Dispose()
188188
{
189-
// Note: storageService (IStorageService) is a singleton
190-
// and should not be disposed here as it is managed by the DI container
189+
// Note: IStorageService parameter is intentionally unused but required for DI
190+
// It is a singleton and should not be disposed here as it is managed by the DI container
191191
}
192192
}

src/Bible.Alarm/ViewModels/Bible/BibleSelectionViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public BibleSelectionViewModel(MediaService mediaService, INavigationService nav
5656
_subscriptions.Add(subscription1);
5757

5858
// Subscribe to subsequent schedule changes (skip first one)
59-
BibleReadingSchedule? lastCurrent = null;
60-
BibleReadingSchedule? lastTentative = null;
59+
BibleReadingSchedule lastCurrent = null;
60+
BibleReadingSchedule lastTentative = null;
6161
var subscription2 = ReduxContainer.Store.Subscribe(state =>
6262
{
6363
if (state.CurrentBibleReadingSchedule != null && state.TentativeBibleReadingSchedule != null

src/Bible.Alarm/ViewModels/Bible/BookSelectionViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public BookSelectionViewModel(MediaService mediaService, INavigationService navi
7777
});
7878

7979
// Subscribe to current schedule changes (but skip first one)
80-
BibleReadingSchedule? lastCurrent = null;
80+
BibleReadingSchedule lastCurrent = null;
8181
var subscription2 = ReduxContainer.Store.Subscribe(state =>
8282
{
8383
if (state.CurrentBibleReadingSchedule != null && state.CurrentBibleReadingSchedule != lastCurrent)

src/Bible.Alarm/ViewModels/Music/SongBookSelectionViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public SongBookSelectionViewModel(MediaService mediaService, INavigationService
5050
_subscriptions.Add(subscription1);
5151

5252
// Subscribe to subsequent music changes (skip first one)
53-
AlarmMusic? lastCurrent = null;
54-
AlarmMusic? lastTentative = null;
53+
AlarmMusic lastCurrent = null;
54+
AlarmMusic lastTentative = null;
5555
var subscription2 = ReduxContainer.Store.Subscribe(state =>
5656
{
5757
if (state.CurrentMusic != null && state.TentativeMusic != null

src/Bible.Alarm/ViewModels/ScheduleListItem.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public class ScheduleListItem : ObservableObject, IComparable, IDisposable, IRec
1919
private readonly IServiceScopeFactory _scopeFactory;
2020

2121
public AlarmSchedule Schedule;
22-
private readonly IDisposable _subscription;
2322

2423
public ScheduleListItem(AlarmSchedule schedule, ILogger logger, IServiceScopeFactory scopeFactory)
2524
{

src/Bible.Alarm/ViewModels/ScheduleViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public ScheduleViewModel(
7171

7272
//set schedules from initial state.
7373
//this should fire only once (look at the where condition).
74-
ScheduleListItem? lastScheduleListItem = null;
74+
ScheduleListItem lastScheduleListItem = null;
7575
bool modelInitialized = false;
7676
IDisposable subscription = null;
7777
subscription = ReduxContainer.Store.Subscribe(async state =>
@@ -123,7 +123,7 @@ public ScheduleViewModel(
123123

124124
_subscriptions.Add(subscription);
125125

126-
AlarmMusic? lastMusic = null;
126+
AlarmMusic lastMusic = null;
127127
var subscription2 = ReduxContainer.Store.Subscribe(state =>
128128
{
129129
if (state.CurrentMusic != null && state.CurrentMusic != lastMusic && state.CurrentMusic != Music)
@@ -136,7 +136,7 @@ public ScheduleViewModel(
136136

137137
_subscriptions.Add(subscription2);
138138

139-
BibleReadingSchedule? lastBibleReading = null;
139+
BibleReadingSchedule lastBibleReading = null;
140140
var subscription3 = ReduxContainer.Store.Subscribe(state =>
141141
{
142142
if (state.CurrentBibleReadingSchedule != null && state.CurrentBibleReadingSchedule != lastBibleReading && state.CurrentBibleReadingSchedule != BibleReadingSchedule)

0 commit comments

Comments
 (0)