diff --git a/app/src/news.json b/app/src/news.json index 6fc1ace2..4bacb5ae 100644 --- a/app/src/news.json +++ b/app/src/news.json @@ -181,5 +181,20 @@ "said": "no account, no ads and no tracking, as always." } ] + }, + { + "version": "3.2.2", + "es": [ + { + "title": "Tisty y LinkUnbound con su mascota", + "said": "en Acerca de, las otras herramientas del mismo autor aparecen con su mascota y llevan a sus propios sitios." + } + ], + "en": [ + { + "title": "Tisty and LinkUnbound with their mascots", + "said": "in About, the author's other tools show their mascots and take you to their own sites." + } + ] } ] diff --git a/app/src/tests/welcome.test.ts b/app/src/tests/welcome.test.ts index 4aefae54..ff5d33c6 100644 --- a/app/src/tests/welcome.test.ts +++ b/app/src/tests/welcome.test.ts @@ -75,14 +75,16 @@ describe("settings opened from the welcome", () => { expect(landing("")).toBe("general"); }); - it("tells someone coming from 2.x what the newest stable release brings", () => { + it("tells someone coming from 2.x what the newest line brought when it opened", () => { const newest = newestStable(); expect(newest).not.toBeNull(); expect(newest).not.toContain("-"); expect(news.some((one) => one.version === newest)).toBe(true); - expect(newestStable(["3.0.0", "3.1.0-rc1", "2.9.9", "3.0.10", "3.0.2"])).toBe("3.0.10"); + expect(newestStable(["3.0.0", "3.1.0-rc1", "2.9.9", "3.0.10", "3.0.2"])).toBe("3.0.0"); expect(newestStable(["3.2.0", "4.0.0", "3.10.0"])).toBe("4.0.0"); expect(newestStable(["3.1.0", "3.10.0", "3.9.0"])).toBe("3.10.0"); + expect(newestStable(["3.2.0", "3.2.2", "3.2.1"])).toBe("3.2.0"); + expect(newestStable(["3.1.0", "3.2.1"])).toBe("3.2.1"); expect(newestStable(["3.1.0-rc1"])).toBeNull(); expect(newestStable([])).toBeNull(); }); diff --git a/app/src/ui/Welcome.tsx b/app/src/ui/Welcome.tsx index cd772c69..a887a756 100644 --- a/app/src/ui/Welcome.tsx +++ b/app/src/ui/Welcome.tsx @@ -48,7 +48,13 @@ export function newestStable(versions: string[] = news.map((one) => one.version) const [x, y] = [parts(a), parts(b)]; return y[0] - x[0] || y[1] - x[1] || y[2] - x[2]; }); - return stable[0] ?? null; + const newest = stable[0]; + if (newest === undefined) { + return null; + } + const [major, minor] = parts(newest); + const opening = `${major}.${minor}.0`; + return stable.includes(opening) ? opening : newest; } export function toldFor(