From f9f0f9c1a4c6bd2207ff884a63c6fd2fbda04f33 Mon Sep 17 00:00:00 2001 From: tobiichi3227 <86729076+tobiichi3227@users.noreply.github.com> Date: Sun, 9 Mar 2025 16:43:39 +0800 Subject: [PATCH] Fix(fortune): Copy preview url without commit hash (#66) --- fortune_generator/js/fortune.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortune_generator/js/fortune.js b/fortune_generator/js/fortune.js index b74af1b..5d10b3e 100644 --- a/fortune_generator/js/fortune.js +++ b/fortune_generator/js/fortune.js @@ -27,10 +27,10 @@ let special_events = []; let commit_hash = ""; // using async and await to prevent fetching the data too late... -async function fetch_data(commit_hash) { +async function fetch_data(requied_commit_hash) { let prefix = ""; - if (commit_hash) { - prefix = `https://raw.githubusercontent.com/LifeAdventurer/generators/${commit_hash}/fortune_generator/`; + if (requied_commit_hash) { + prefix = `https://raw.githubusercontent.com/LifeAdventurer/generators/${requied_commit_hash}/fortune_generator/`; } await fetch(`${prefix}./json/fortune.json`) .then((response) => response.json())