From 619508b16c7089377d8413f9ee5506354f446ab1 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 8 Mar 2025 00:30:30 +1100 Subject: files: change directory monitor return Only return the outermost monitor, hook onto that to cancel the nested ones Also use the monitor flags in hopes of it actually picking up changes to files (it doesnt) --- src/services/wallpapers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/services') diff --git a/src/services/wallpapers.ts b/src/services/wallpapers.ts index 39bced4..9a4e5bb 100644 --- a/src/services/wallpapers.ts +++ b/src/services/wallpapers.ts @@ -58,10 +58,10 @@ export default class Wallpapers extends GObject.Object { let monitors = config.paths .get() - .flatMap(p => monitorDirectory(p.path, () => this.update().catch(console.error), p.recursive)); + .map(p => monitorDirectory(p.path, () => this.update().catch(console.error), p.recursive)); config.paths.subscribe(v => { for (const m of monitors) m.cancel(); - monitors = v.flatMap(p => monitorDirectory(p.path, () => this.update().catch(console.error), p.recursive)); + monitors = v.map(p => monitorDirectory(p.path, () => this.update().catch(console.error), p.recursive)); }); } } -- cgit v1.2.3-freya