Skip to content

Commit

Permalink
fix: hide popover after login
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed Jun 11, 2024
1 parent 1f3f661 commit f68b3a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ export const ConnectButtonModule = (
tap((items) => (connectButtonElement.requestItems = items)),
)

const showPopoverMenu$ = subjects.showPopoverMenu.pipe(
tap((value) => (connectButtonElement.showPopoverMenu = value)),
)

const accounts$ = subjects.accounts.pipe(
tap((items) => (connectButtonElement.accounts = items)),
)
Expand All @@ -220,6 +224,7 @@ export const ConnectButtonModule = (
theme$,
mode$,
connected$,
showPopoverMenu$,
requestItems$,
loggedInTimestamp$,
isMobile$,
Expand Down Expand Up @@ -295,6 +300,7 @@ export const ConnectButtonModule = (
setLoggedInTimestamp: (value: string) =>
subjects.loggedInTimestamp.next(value),
setConnected: (value: boolean) => subjects.connected.next(value),
setShowPopoverMenu: (value: boolean) => subjects.showPopoverMenu.next(value),
setRequestItems: (items: RequestItem[]) =>
subjects.requestItems.next(items),
setAccounts: (accounts: Account[]) => subjects.accounts.next(accounts),
Expand Down Expand Up @@ -377,7 +383,8 @@ export const ConnectButtonModule = (
isConnect: true,
oneTime: false,
}),
),
)
.map(() => subjects.showPopoverMenu.next(false)),
),
)
.subscribe(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ConnectButtonSubjects = () => ({
loggedInTimestamp: new BehaviorSubject<string>(''),
isMobile: new BehaviorSubject<boolean>(isMobile()),
isWalletLinked: new BehaviorSubject<boolean>(false),
showPopoverMenu: new BehaviorSubject<boolean>(false),
isExtensionAvailable: new BehaviorSubject<boolean>(false),
fullWidth: new BehaviorSubject<boolean>(false),
activeTab: new BehaviorSubject<'sharing' | 'requests'>('sharing'),
Expand Down

0 comments on commit f68b3a8

Please sign in to comment.