Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix canister id in test app #1857

Merged
merged 1 commit into from
Sep 7, 2023
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
6 changes: 3 additions & 3 deletions demos/test-app/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ lazy_static! {
let canister_id = api::id();
let index_html = include_str!("dist/index.html");

// the string we are replacing here is inserted by webpack during the front-end build
// the string we are replacing here is inserted by vite during the front-end build
let index_html = index_html.replace(
r#"<script defer src="bundle.js"></script>"#,
&format!(r#"<script>var canisterId = '{canister_id}';</script><script defer="defer" src="bundle.js"></script>"#).to_string()
r#"<script type="module" crossorigin src="/index.js"></script>"#,
&format!(r#"<script>var canisterId = '{canister_id}';</script><script type="module" crossorigin src="/index.js"></script>"#).to_string()
);
index_html
};
Expand Down
2 changes: 1 addition & 1 deletion demos/test-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>Contact the IC</h1>
<label for="canisterId" style="display: inline-block; width: 120px"
>Canister ID:
</label>
<input type="text" id="canisterId" value="kvusz-kaaaa-aaaad-aabwa-cai" />
<input type="text" id="canisterId" />
</div>
<div>
<button id="whoamiBtn">Who Am I?</button>
Expand Down