Fix(fortune): Copy preview url without commit hash (#66)

This commit was merged in pull request #66.
This commit is contained in:
tobiichi3227
2025-03-09 16:43:39 +08:00
committed by GitHub
parent cf9254c60c
commit f9f0f9c1a4

View File

@@ -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())