We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e54cb0 commit 3d3e23cCopy full SHA for 3d3e23c
src/lib/state/token.svelte.ts
@@ -1,5 +1,5 @@
1
+import { env } from "$env/dynamic/public";
2
import { safeParse } from "$lib/utils/json.js";
-import { PUBLIC_HF_TOKEN } from "$env/static/public";
3
import typia from "typia";
4
5
const key = "hf_token";
@@ -9,8 +9,8 @@ class Token {
9
writeToLocalStorage = $state(true);
10
11
constructor() {
12
- if (PUBLIC_HF_TOKEN) {
13
- this.#value = PUBLIC_HF_TOKEN;
+ if (env.PUBLIC_HF_TOKEN) {
+ this.#value = env.PUBLIC_HF_TOKEN;
14
return;
15
}
16
@@ -59,7 +59,7 @@ class Token {
59
reset = () => {
60
this.value = "";
61
localStorage.removeItem(key);
62
- if (!PUBLIC_HF_TOKEN) {
+ if (!env.PUBLIC_HF_TOKEN) {
63
this.requestTokenFromParent();
64
65
};
0 commit comments