@@ -18,7 +18,7 @@ public partial class MainWindow : Window
1818 private CancellationTokenSource ? _cancellationTokenSource ;
1919 private bool _isServiceRunning = false ;
2020 private static readonly Guid ServiceUuid = new ( "8ce255c0-200a-11e0-ac64-0800200c9a66" ) ;
21-
21+
2222 // Clipboard monitoring for auto-sync
2323 private System . Windows . Threading . DispatcherTimer ? _clipboardMonitorTimer ;
2424 private string ? _lastClipboardContent ;
@@ -63,13 +63,8 @@ public MainWindow()
6363 Interval = TimeSpan . FromMilliseconds ( 500 )
6464 } ;
6565 _clipboardMonitorTimer . Tick += ClipboardMonitor_Tick ;
66-
67- // Load settings and start monitoring if enabled
68- var settings = SettingsService . LoadSettings ( ) ;
69- if ( settings . AutoSyncEnabled )
70- {
71- _clipboardMonitorTimer . Start ( ) ;
72- }
66+
67+ _clipboardMonitorTimer . Start ( ) ;
7368 }
7469
7570 private void ThemeToggleButton_Click ( object sender , RoutedEventArgs e )
@@ -321,13 +316,9 @@ await Task.Run(() =>
321316 private void ClipboardMonitor_Tick ( object ? sender , EventArgs e )
322317 {
323318 var settings = SettingsService . LoadSettings ( ) ;
324-
325- // Stop monitoring if auto-sync is disabled
326- if ( ! settings . AutoSyncEnabled )
327- {
328- _clipboardMonitorTimer ? . Stop ( ) ;
329- return ;
330- }
319+
320+ // Skip if auto-sync is disabled
321+ if ( ! settings . AutoSyncEnabled ) return ;
331322
332323 // Skip if we're currently receiving clipboard from another device
333324 if ( _isReceivingClipboard ) return ;
@@ -340,7 +331,7 @@ private void ClipboardMonitor_Tick(object? sender, EventArgs e)
340331 if ( ! Clipboard . ContainsText ( ) ) return ;
341332
342333 var currentClipboard = Clipboard . GetText ( ) ;
343-
334+
344335 // Skip empty or whitespace-only content
345336 if ( string . IsNullOrWhiteSpace ( currentClipboard ) ) return ;
346337
0 commit comments