From d178ca5667d8c434f31e562c5369553b5acde096 Mon Sep 17 00:00:00 2001 From: Daniel Ji Date: Mon, 12 Feb 2024 21:41:14 -0800 Subject: [PATCH] fix offline instructions on site --- src/App.jsx | 6 ++++-- src/constants.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index f8c7882..d9a8d9d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -12,7 +12,8 @@ import { MINIMAP2_VERSION, FASTP_VERSION, OFFLINE_INSTRUCTIONS, - OFFLINE_INSTRUCTIONS_KEYWORDS, + OFFLINE_INSTRUCTIONS_KEYWORDS_START, + OFFLINE_INSTRUCTIONS_KEYWORDS_END, REF_GENOMES_DIR, REF_GENOME_REPO_STRUCTURE_LINK, CLEAR_LOG, @@ -147,7 +148,8 @@ export class App extends Component { const res = await fetch(`${window.location.origin}${import.meta.env.BASE_URL || ''}${OFFLINE_INSTRUCTIONS}`); const text = await res.text(); const html = marked(text); - const offlineInstructions = html.slice(html.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS) + OFFLINE_INSTRUCTIONS_KEYWORDS.length) + let offlineInstructions = html.slice(html.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS_START) + OFFLINE_INSTRUCTIONS_KEYWORDS_START.length) + offlineInstructions = offlineInstructions.slice(0, offlineInstructions.indexOf(OFFLINE_INSTRUCTIONS_KEYWORDS_END)) this.setState({ offlineInstructions }); } diff --git a/src/constants.js b/src/constants.js index f67465b..87a5e38 100644 --- a/src/constants.js +++ b/src/constants.js @@ -7,7 +7,8 @@ export const REF_GENOMES_DIR = "data/Reference-Genomes/"; export const REF_GENOME_REPO_STRUCTURE_LINK = "data/REFS.json"; export const OFFLINE_INSTRUCTIONS = "/README.md"; -export const OFFLINE_INSTRUCTIONS_KEYWORDS = "

ViralWasm-Consensus Offline

\n"; +export const OFFLINE_INSTRUCTIONS_KEYWORDS_START = "

ViralWasm-Consensus Offline

\n"; +export const OFFLINE_INSTRUCTIONS_KEYWORDS_END = "

Citing ViralWasm-Consensus

\n"; export const BIOWASM_WORKING_DIR = "/shared/data/"; export const OUTPUT_ID = "output-text"; export const EXAMPLE_REF = "NC_045512"; // SARS-CoV-2 (COVID-19)