repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

fix(git-safe): recover tracked paths during session start

07044acd2e35e8ee072bc04bfcb3eb9542d7b1f6

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

extensions/git-safe/index.ts

Modified
73 73 // ── session_start: recover tracked paths ─────────────────────────────
75 - pi.on("session_start", (_event, ctx) => {
75 + pi.on("session_start", async (_event, ctx) => {
76 76 const ticket = ++generation;
77 - setTimeout(() => {
78 - void (async () => {
79 - const paths = await recoverTrackedPaths(ctx.cwd);
80 - if (ticket !== generation) return;
81 - for (const p of paths) {
82 - addTrackedPath(p);
83 - }
84 - if (paths.length > 0 && ctx.hasUI) {
85 - ctx.ui.notify(
86 - `git-safe: recovered ${paths.length} tracked clone(s)`,
87 - "info",
88 - );
89 - }
90 - })();
91 - }, 0);
77 + const paths = await recoverTrackedPaths(ctx.cwd);
78 + if (ticket !== generation) return;
79 + for (const p of paths) {
80 + addTrackedPath(p);
81 + }
82 + if (paths.length > 0 && ctx.hasUI) {
83 + ctx.ui.notify(
84 + `git-safe: recovered ${paths.length} tracked clone(s)`,
85 + "info",
86 + );
87 + }
94 90 pi.on("session_shutdown", async () => {