mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +08:00
NoteBacklinksRenderer: Add debug logs
This renderer occasionally hangs, I'm not 100% sure why, and these logs will help diagnose the issue.
This commit is contained in:
@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gitjournal/core/link.dart';
|
import 'package:gitjournal/core/link.dart';
|
||||||
|
import 'package:gitjournal/utils/logger.dart';
|
||||||
import 'package:gitjournal/widgets/pro_overlay.dart';
|
import 'package:gitjournal/widgets/pro_overlay.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
|
|
||||||
@ -35,6 +36,8 @@ class _NoteBacklinkRendererState extends State<NoteBacklinkRenderer> {
|
|||||||
|
|
||||||
Future<void> _initStateAsync() async {
|
Future<void> _initStateAsync() async {
|
||||||
var predicate = (Note n) async {
|
var predicate = (Note n) async {
|
||||||
|
Log.d("NoteBacklinkRenderer Predicate", props: {"filePath": n.filePath});
|
||||||
|
|
||||||
var links = await n.fetchLinks();
|
var links = await n.fetchLinks();
|
||||||
var matchedLink = links.firstWhere(
|
var matchedLink = links.firstWhere(
|
||||||
(l) {
|
(l) {
|
||||||
@ -48,6 +51,8 @@ class _NoteBacklinkRendererState extends State<NoteBacklinkRenderer> {
|
|||||||
},
|
},
|
||||||
orElse: () => null,
|
orElse: () => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Log.d("NoteBacklinkRenderer Predicate ${matchedLink != null}");
|
||||||
return matchedLink != null;
|
return matchedLink != null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user