Fix regression reloading pages changed "on disk"

pull/893/head
Zef Hemel 2024-06-14 08:44:46 +02:00
parent bb8f594a68
commit bd3e91ba65
1 changed files with 1 additions and 2 deletions

View File

@ -600,13 +600,12 @@ export class Client {
"file:changed",
(
path: string,
localChange: boolean,
_localChange: boolean,
oldHash: number,
newHash: number,
) => {
// Only reload when watching the current page (to avoid reloading when switching pages)
if (
!localChange &&
this.space.watchInterval && `${this.currentPage}.md` === path &&
// Avoid reloading if the page was just saved (5s window)
(!lastSaveTimestamp || (lastSaveTimestamp < Date.now() - 5000))