honeytree 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/auth.js +1 -1
- package/src/components/ForestApp.js +1 -1
- package/src/components/StatsBar.js +0 -9
- package/src/plant-real.js +1 -1
- package/src/rewards.js +1 -1
- package/src/sync.js +1 -1
package/package.json
CHANGED
package/src/auth.js
CHANGED
|
@@ -29,7 +29,7 @@ export function isLoggedIn() {
|
|
|
29
29
|
return !!(auth && auth.access_token);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export async function loginWithDevice(apiUrl = process.env.HONEYTREE_API_URL || "https://tryhoney.xyz") {
|
|
32
|
+
export async function loginWithDevice(apiUrl = process.env.HONEYTREE_API_URL || "https://www.tryhoney.xyz") {
|
|
33
33
|
const res = await fetch(`${apiUrl}/api/auth/device`, { method: "POST" });
|
|
34
34
|
const contentType = res.headers.get("content-type") || "";
|
|
35
35
|
if (!contentType.includes("application/json")) {
|
|
@@ -302,7 +302,7 @@ export default function ForestApp() {
|
|
|
302
302
|
// Open checkout in browser
|
|
303
303
|
const auth = getAuth();
|
|
304
304
|
if (auth && auth.access_token) {
|
|
305
|
-
fetch("https://tryhoney.xyz/api/checkout", {
|
|
305
|
+
fetch("https://www.tryhoney.xyz/api/checkout", {
|
|
306
306
|
method: "POST",
|
|
307
307
|
headers: {
|
|
308
308
|
"Content-Type": "application/json",
|
|
@@ -11,7 +11,6 @@ const STATS_TEXT = "#8e8a84";
|
|
|
11
11
|
const STATS_WARN = "#c4653a";
|
|
12
12
|
const STREAK_COLOR = "#e8a33a";
|
|
13
13
|
const BAR_FILL = "#6cb95e";
|
|
14
|
-
const BAR_EMPTY = "#3d3d3d";
|
|
15
14
|
|
|
16
15
|
export default function StatsBar({ forest, viewportX, termWidth, rewards }) {
|
|
17
16
|
const vw = getVirtualWidth(forest.trees.length, termWidth);
|
|
@@ -20,9 +19,6 @@ export default function StatsBar({ forest, viewportX, termWidth, rewards }) {
|
|
|
20
19
|
[forest, viewportX, vw, termWidth],
|
|
21
20
|
);
|
|
22
21
|
|
|
23
|
-
const barWidth = 12;
|
|
24
|
-
const filledWidth = Math.max(0, Math.min(barWidth, Math.round(stats.progress * barWidth)));
|
|
25
|
-
|
|
26
22
|
// Minimap
|
|
27
23
|
let minimap = null;
|
|
28
24
|
if (stats.virtualWidth > stats.termWidth) {
|
|
@@ -55,11 +51,6 @@ export default function StatsBar({ forest, viewportX, termWidth, rewards }) {
|
|
|
55
51
|
h(Text, { color: STATS_ACCENT }, " honeytree"),
|
|
56
52
|
h(Text, { color: STATS_TEXT }, ` · ${stats.treeCount} tree${stats.treeCount === 1 ? "" : "s"} · `),
|
|
57
53
|
streakSegment,
|
|
58
|
-
h(Text, { color: STATS_TEXT }, " · "),
|
|
59
|
-
h(Text, { color: BAR_FILL }, "█".repeat(filledWidth)),
|
|
60
|
-
h(Text, { color: BAR_EMPTY }, "░".repeat(barWidth - filledWidth)),
|
|
61
|
-
h(Text, { color: STATS_TEXT }, ` next: ${stats.nextTreeType}`),
|
|
62
|
-
h(Text, { color: "#555555" }, ` [${stats.biomeName}]`),
|
|
63
54
|
minimap,
|
|
64
55
|
),
|
|
65
56
|
h(Box, null,
|
package/src/plant-real.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readForest } from "./state.js";
|
|
|
4
4
|
import { syncToCloud } from "./sync.js";
|
|
5
5
|
import { asciiTree } from "./ascii-tree.js";
|
|
6
6
|
|
|
7
|
-
const API_URL = process.env.HONEYTREE_API_URL || "https://tryhoney.xyz";
|
|
7
|
+
const API_URL = process.env.HONEYTREE_API_URL || "https://www.tryhoney.xyz";
|
|
8
8
|
const POLL_INTERVAL_MS = 4000;
|
|
9
9
|
const POLL_TIMEOUT_MS = 5 * 60 * 1000;
|
|
10
10
|
|
package/src/rewards.js
CHANGED
|
@@ -40,7 +40,7 @@ export function hasCherryBlossom() { return hasReward("cherry"); }
|
|
|
40
40
|
|
|
41
41
|
// Fetch rewards from server and cache locally
|
|
42
42
|
export async function syncRewards(apiUrl) {
|
|
43
|
-
apiUrl = apiUrl || process.env.HONEYTREE_API_URL || "https://tryhoney.xyz";
|
|
43
|
+
apiUrl = apiUrl || process.env.HONEYTREE_API_URL || "https://www.tryhoney.xyz";
|
|
44
44
|
const { getAuth } = await import("./auth.js");
|
|
45
45
|
const auth = getAuth();
|
|
46
46
|
if (!auth || !auth.access_token) return null;
|
package/src/sync.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAuth, saveAuth } from "./auth.js";
|
|
2
2
|
import { readForest } from "./state.js";
|
|
3
3
|
|
|
4
|
-
const API_URL = process.env.HONEYTREE_API_URL || "https://tryhoney.xyz";
|
|
4
|
+
const API_URL = process.env.HONEYTREE_API_URL || "https://www.tryhoney.xyz";
|
|
5
5
|
|
|
6
6
|
export async function syncToCloud(forest) {
|
|
7
7
|
const auth = getAuth();
|