Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
4babd7f1
Commit
4babd7f1
authored
Mar 13, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
Mar 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate session to TypeScript
parent
93b51390
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
session.ts
src/sidebar/helpers/session.ts
+10
-10
No files found.
src/sidebar/helpers/session.
j
s
→
src/sidebar/helpers/session.
t
s
View file @
4babd7f1
import
type
{
Profile
}
from
'../../types/api'
;
import
type
{
SidebarSettings
}
from
'../../types/config'
;
import
{
serviceConfig
}
from
'../config/service-config'
;
import
{
serviceConfig
}
from
'../config/service-config'
;
/**
* @typedef {import('../../types/config').SidebarSettings} SidebarSettings
* @typedef {import('../../types/api').Profile} Profile
*/
/**
/**
* The following things must all be true for the tutorial component to auto-display
* The following things must all be true for the tutorial component to auto-display
* on app launch:
* on app launch:
...
@@ -18,12 +15,15 @@ import { serviceConfig } from '../config/service-config';
...
@@ -18,12 +15,15 @@ import { serviceConfig } from '../config/service-config';
* dismissed by this user yet). This implies the presence of a profile, which
* dismissed by this user yet). This implies the presence of a profile, which
* in turn implies that there is an authenticated user.
* in turn implies that there is an authenticated user.
*
*
* @param {boolean} isSidebar - is the app currently displayed in a sidebar?
* @param isSidebar - is the app currently displayed in a sidebar?
* @param {Profile} profile - User profile returned from the API
* @param profile - User profile returned from the API
* @param {SidebarSettings} settings
* @return Tutorial panel should be displayed automatically
* @return {boolean} - Tutorial panel should be displayed automatically
*/
*/
export
function
shouldAutoDisplayTutorial
(
isSidebar
,
profile
,
settings
)
{
export
function
shouldAutoDisplayTutorial
(
isSidebar
:
boolean
,
profile
:
Profile
,
settings
:
SidebarSettings
):
boolean
{
const
shouldShowBasedOnProfile
=
const
shouldShowBasedOnProfile
=
typeof
profile
.
preferences
===
'object'
&&
typeof
profile
.
preferences
===
'object'
&&
!!
profile
.
preferences
.
show_sidebar_tutorial
;
!!
profile
.
preferences
.
show_sidebar_tutorial
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment