From 5d204a133113c3b4b009b457c6480d4979e6fa09 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Wed, 25 Nov 2020 23:43:30 +0300 Subject: [PATCH] avoid reloading previews modified in the future Related #453 --- nav.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nav.go b/nav.go index d80e339..befdc2c 100644 --- a/nav.go +++ b/nav.go @@ -527,8 +527,16 @@ func (nav *nav) checkReg(reg *reg) { return } + now := time.Now() + + // XXX: Linux builtin exFAT drivers are able to predict modifications in the future + // https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1872504 + if s.ModTime().After(now) { + return + } + if s.ModTime().After(reg.loadTime) { - reg.loadTime = time.Now() + reg.loadTime = now go nav.preview(reg.path) } }