Skip to content

Commit a1b251b

Browse files
Add note refresh
1 parent 649a264 commit a1b251b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/frontend/lib/providers/note_editor_provider.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,17 +1527,6 @@ class NoteEditorProvider with ChangeNotifier implements NoteEditorViewModel {
15271527
}
15281528
}
15291529

1530-
@override
1531-
void updateBlockCache(List<Block> blocks) {
1532-
for (final block in blocks) {
1533-
// Only update if this block belongs to an active note
1534-
if (_noteId == block.noteId || _activeNoteIds.contains(block.noteId)) {
1535-
_blocks[block.id] = block;
1536-
_documentBuilder.registerServerBlock(block);
1537-
}
1538-
}
1539-
}
1540-
15411530
@override
15421531
void commitAllContent() {
15431532
_logger.debug('Committing content for all blocks');

src/frontend/lib/screens/note_editor_screen.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,15 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
361361
title: '', // Empty title as we have our own title field
362362
showBackButton: false, // No back button in app bar
363363
actions: [
364+
IconButton(
365+
icon: const Icon(Icons.refresh_outlined),
366+
tooltip: 'Refresh note content',
367+
onPressed: () => _noteEditorViewModel.updateBlocks(
368+
_noteEditorViewModel.blocks,
369+
preserveFocus: true,
370+
markAsModified: false,
371+
),
372+
),
364373
IconButton(
365374
icon: const Icon(Icons.upload_file),
366375
tooltip: 'Import Markdown',

src/frontend/lib/viewmodel/note_editor_viewmodel.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ abstract class NoteEditorViewModel extends BaseViewModel {
7070
Map<String, dynamic> getPaginationInfo(String noteId);
7171

7272
// Server sync and events
73-
void updateBlockCache(List<Block> blocks);
7473
void commitAllContent();
7574
Future<void> fetchBlockFromEvent(String blockId);
7675

0 commit comments

Comments
 (0)