-
Notifications
You must be signed in to change notification settings - Fork 20
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
attempt to start, redirect to onboarding #720
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to be getting some strange loading artifacts (sometimes no UI, sometimes just loading bar).
Also with the exponential backoff, I suppose we are hoping it initializes after the wallet gets added with not too much wait? What about onboarding sending an initialization message (think we had that before?).
newmovie.mov
24134b4
to
a1b36f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like one of the root causes was that parameters were not yet present in idb - imo either minifront should handle that condition, or services init should ensure they're present, but this was a simpler fix
i wasn't able to achieve some of the UI states you showed in this video, but i did make the first load reliable.
now using both. |
15a21b9
to
8e88eb5
Compare
const params = await this.querier.app.appParams(); | ||
if (!params.sctParams?.epochDuration) throw new Error('Epoch duration unknown'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pairing with @jessepinho i think it's not appropriate to get epoch duration here but that should be a separate issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One small Q but feel free to merge if I'm missing something
return { parameters }; | ||
if (parameters) return { parameters }; | ||
for await (const update of subscription) | ||
return { parameters: AppParameters.fromJson(update.value) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice — does this prevent the error that often shows up after clearing the cache that says something about not being able to find AppParameters? If so, this is a great solution!
|
||
if (!wallets.length) { | ||
await chrome.tabs.create({ url: chrome.runtime.getURL(`page.html`) }); | ||
window.close(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we OK with not checking for wallets anymore? Don't we want to check await needsLogin()
and await needsOnboard()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the login page cascades to needsOnboard
8e88eb5
to
26b9c97
Compare
export const needsLogin = async (): Promise<Response | undefined> => { | ||
const password = await sessionExtStorage.get('passwordKey'); | ||
if (password) return; | ||
|
||
return redirect(PopupPath.LOGIN); | ||
}; | ||
|
||
export const needsOnboard = async () => { | ||
const wallets = await localExtStorage.get('wallets'); | ||
if (wallets.length) return; | ||
|
||
void chrome.runtime.openOptionsPage(); | ||
window.close(); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to return null right? Otherwise there will be that extension update error we saw while pairing.
solves #712