[fix] sodium not loading
This commit is contained in:
@@ -39,6 +39,12 @@ export const novelLogin = async () => {
|
|||||||
|
|
||||||
|
|
||||||
alertWait('Logging in to NovelAI')
|
alertWait('Logging in to NovelAI')
|
||||||
|
|
||||||
|
let tries = 0
|
||||||
|
let error = ''
|
||||||
|
while (tries < 3) {
|
||||||
|
try {
|
||||||
|
|
||||||
const _sodium = await import('libsodium-wrappers-sumo')
|
const _sodium = await import('libsodium-wrappers-sumo')
|
||||||
await sleep(1000)
|
await sleep(1000)
|
||||||
await _sodium.ready
|
await _sodium.ready
|
||||||
@@ -86,8 +92,14 @@ export const novelLogin = async () => {
|
|||||||
|
|
||||||
alertNormal('Logged in to NovelAI')
|
alertNormal('Logged in to NovelAI')
|
||||||
setDatabase(db)
|
setDatabase(db)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
error = (`Failed to authenticate with NovelAI: ${error}`)
|
||||||
|
tries++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alertError(error)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
alertError(`Failed to authenticate with NovelAI: ${error}`)
|
alertError(`Failed to authenticate with NovelAI: ${error}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user