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

Support NotLoggedIn status on connection page #787

Merged
merged 4 commits into from
Mar 20, 2024
Merged

Conversation

grod220
Copy link
Collaborator

@grod220 grod220 commented Mar 18, 2024

Closes #775

We now handle the not-logged-in state and surface the error to the user on the connection page. After discussion in web weekly, agreed to simply throw error instead of handling login-redirect logic done in #772.

@TalDerei
Copy link
Contributor

might something like this, similar to when when a user tries to initiate a transaction when the wallet is locked, in red be cleaner?

Screenshot 2024-03-18 at 3 00 37 PM

@grod220 grod220 force-pushed the connection-status branch from 020ee44 to 41e1522 Compare March 18, 2024 22:55
@grod220
Copy link
Collaborator Author

grod220 commented Mar 18, 2024

Now using toasts:

Screenshot 2024-03-18 at 10 54 55 PM Screenshot 2024-03-18 at 10 54 30 PM

Copy link
Contributor

@turbocrime turbocrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have some suggestions about message types i will pr to this branch

Copy link
Contributor

@turbocrime turbocrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @grod220 for approval

some of this diff is a bit larger than needs be

improved popup etc

importantly: failure reasons no longer prax-specific, part of client package

@@ -1,3 +1,8 @@
export enum PenumbraRequestFailure {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failure reasons not prax-specific

@@ -1,37 +1,30 @@
import { sessionExtStorage } from '@penumbra-zone/storage';
import { PopupMessage, PopupRequest, PopupResponse, PopupType } from './message/popup';
import { PopupMessage, PopupRequest, PopupType } from './message/popup';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-response handled in popup launcher

@@ -61,6 +61,7 @@ export const createOriginApprovalSlice = (): SliceCreator<OriginApprovalSlice> =
data: {
choice,
origin: requestOrigin,
date: Date.now(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slice just returns an actual complete record now

void spawnExtensionPopup(popUrl.href);
throw new ConnectError('User must login to extension', Code.Unauthenticated);
}

switch (pop) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs login composable per popup type (future popups may not need it?)

@grod220 grod220 merged commit 7a1efed into main Mar 20, 2024
6 checks passed
@grod220 grod220 deleted the connection-status branch March 20, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

not allowed to open popup programmatically
3 participants