Skip to content

Commit

Permalink
add link to launch onboard window (#1417)
Browse files Browse the repository at this point in the history
* add link to launch onboard window

* change capital letter
  • Loading branch information
mholtzman authored Feb 14, 2023
1 parent d27140e commit 45ec2df
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/dash/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,16 @@ class Settings extends React.Component {
Need help? Join our Discord!
</div>
</div>
<div className='requestFeature'>
<div
className='requestFeatureButton'
onClick={() => {
link.send('tray:action', 'setOnboard', { showing: true })
}}
>
Open Frame Tutorial
</div>
</div>
<div className='requestFeature'>
<div
className='requestFeatureButton'
Expand Down
4 changes: 4 additions & 0 deletions main/store/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ module.exports = {
}
u('windows.dash', (dash) => Object.assign(dash, update))
},
setOnboard: (u, update) => {
u('windows.onboard.showing', () => update.showing)
},
navForward: (u, windowId, crumb) => {
if (!windowId || !crumb) return log.warn('Invalid nav forward', windowId, crumb)
u('windows', windowId, 'nav', (nav) => {
Expand Down Expand Up @@ -768,6 +771,7 @@ module.exports = {
},
completeOnboarding: (u) => {
u('main.mute.onboardingWindow', () => true)
u('windows.onboard.showing', () => false)
},
// Dapp Frame
appDapp: (u, dapp) => {
Expand Down
11 changes: 11 additions & 0 deletions main/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,17 @@ const init = () => {
dash.hide()
windows.tray.focus()
}

if (store('windows.onboard.showing')) {
if (!windows.onboard) {
onboard = new Onboard()
}

onboard.show()
} else if (onboard) {
onboard.hide()
windows.tray.focus()
}
})

store.observer(() => broadcast('permissions', JSON.stringify(store('permissions'))))
Expand Down

0 comments on commit 45ec2df

Please sign in to comment.