Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/chrome/app-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const COMMUNITY = {
};

const PROJECTS = {
armoria: link("https://azgaar.github.io/Armoria", "Armoria"),
armoria: link("https://armoria.vercel.app/", "Armoria"),
deorum: link("https://deorum.vercel.app", "Deorum")
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/chrome/tabs/about-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const TEMPLATE = /* html */ `
</div>
<div style="text-align: left">
<p>${t("Check out our other projects")}:</p>
<div>• <a href="https://azgaar.github.io/Armoria" target="_blank">Armoria</a>: ${t("a tool for creating coats of arms")}</div>
<div>• <a href="https://armoria.vercel.app/" target="_blank">Armoria</a>: ${t("a tool for creating coats of arms")}</div>
<div>• <a href="https://deorum.vercel.app" target="_blank">Deorum</a>: ${t("gallery of fantasy characters")}</div>
</div>
<ul class="share-buttons">
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/political/emblems/armoria-sessions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { expect, it } from "vitest";
import { ArmoriaSessions } from "./armoria-sessions";

const origin = "https://azgaar.github.io";
const origin = "https://armoria.vercel.app";
const update = (session: string, overrides: Record<string, unknown> = {}, from = origin) =>
new MessageEvent("message", {
origin: from,
Expand All @@ -14,6 +14,7 @@ it("accepts every valid update of a live session, and nothing else", () => {
const map = {};
const token = sessions.start("state:1", "state:1", map);
expect(sessions.receive(update(token, {}, "https://example.com"), map)).toBeNull();
expect(sessions.receive(update(token, {}, "https://azgaar.github.io"), map)).toBeNull();
expect(sessions.receive(update(token, { version: 2 }), map)).toBeNull();
expect(sessions.receive(update(token, { coa: { charges: [] } }), map)).toBeNull();
expect(sessions.receive(update("unknown"), map)).toBeNull();
Expand Down
1 change: 1 addition & 0 deletions src/model/political/armoria.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const coa = { t1: "gules", charges: [{ charge: "lionRampant", t: "or", p: "e" }]

describe("Armoria input", () => {
it.each([
`https://armoria.vercel.app/?coa=${encodeURIComponent(JSON.stringify(coa))}`,
`https://azgaar.github.io/Armoria/?coa=${encodeURIComponent(JSON.stringify(coa))}`,
`https://armoria.vercel.app/api?size=500&format=png&coa=${encodeURIComponent(JSON.stringify(coa))}`,
`https://armoria.herokuapp.com/?size=500&format=png&coa=${encodeURIComponent(JSON.stringify(coa))}`,
Expand Down
6 changes: 4 additions & 2 deletions src/model/political/armoria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { CustomIcon } from "@/model/icons";
import type { HeraldicEmblem } from "@/types/emblems";
import { t } from "@/utils/i18n";

const GUI = "https://azgaar.github.io/Armoria/";
const GUI = "https://armoria.vercel.app/";
const LEGACY_GUI = "https://azgaar.github.io/Armoria/";
const API = "https://armoria.vercel.app/api";
const LEGACY_API = /^https?:\/\/armoria\.herokuapp\.com\/?(\?)?/; // retired host of older links
const FILE_KEYWORD = "armoria-coa";
Expand Down Expand Up @@ -33,7 +34,8 @@ function parse(input: string): HeraldicEmblem {
throw new Error(t("The link is not a valid URL"));
}
const isArmoria =
(url.origin === new URL(GUI).origin && url.pathname.startsWith("/Armoria")) || url.origin === new URL(API).origin;
(url.origin === new URL(LEGACY_GUI).origin && url.pathname.startsWith("/Armoria")) ||
url.origin === new URL(GUI).origin;
// a seed or claim link names no COA, and seeds are not stable across Armoria versions
if (!isArmoria || !url.searchParams.has("coa")) throw new Error(NOT_ARMORIA);
return parseCoa(url.searchParams.get("coa") ?? "");
Expand Down
Loading