Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
1e7eef3
1
Parent(s):
3f55819
this is driving me crazy
Browse files
src/app/state/useCurrentUser.ts
CHANGED
@@ -59,9 +59,9 @@ export function useCurrentUser({
|
|
59 |
let huggingfaceTemporaryApiKey = localStorage.getItem(localStorageKeys.huggingfaceTemporaryApiKey) || ""
|
60 |
|
61 |
console.log("huggingfaceTemporaryApiKey:", huggingfaceTemporaryApiKey)
|
62 |
-
if (
|
63 |
console.log("the key has been corrupted..")
|
64 |
-
localStorage.setItem(localStorageKeys.huggingfaceTemporaryApiKey, JSON.parse(
|
65 |
huggingfaceTemporaryApiKey = localStorage.getItem(localStorageKeys.huggingfaceTemporaryApiKey) || ""
|
66 |
console.log(`the recovered key is: ${huggingfaceTemporaryApiKey}`)
|
67 |
}
|
|
|
59 |
let huggingfaceTemporaryApiKey = localStorage.getItem(localStorageKeys.huggingfaceTemporaryApiKey) || ""
|
60 |
|
61 |
console.log("huggingfaceTemporaryApiKey:", huggingfaceTemporaryApiKey)
|
62 |
+
if (huggingfaceTemporaryApiKey.startsWith('"')) {
|
63 |
console.log("the key has been corrupted..")
|
64 |
+
localStorage.setItem(localStorageKeys.huggingfaceTemporaryApiKey, JSON.parse(huggingfaceTemporaryApiKey))
|
65 |
huggingfaceTemporaryApiKey = localStorage.getItem(localStorageKeys.huggingfaceTemporaryApiKey) || ""
|
66 |
console.log(`the recovered key is: ${huggingfaceTemporaryApiKey}`)
|
67 |
}
|