Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
896
Issues
896
List
Boards
Labels
Service Desk
Milestones
Merge Requests
48
Merge Requests
48
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
508f2919
Commit
508f2919
authored
53 minutes ago
by
Marcelo Rivera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(chore): moved sessionStorage logic to a new SessionStorageService
parent
451e611b
epic/minds-pro
1 merge request
!528
WIP: (feat): Minds Pro
Pipeline
#80498741
failed with stages
in 6 minutes and 56 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
7 deletions
+30
-7
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+3
-1
channel.service.ts
src/app/modules/pro/channel/channel.service.ts
+5
-3
providers.ts
src/app/services/providers.ts
+7
-1
session-storage.service.ts
src/app/services/session-storage.service.ts
+15
-0
storage.ts
src/app/services/storage.ts
+0
-2
No files found.
src/app/modules/pro/channel/channel.component.ts
View file @
508f2919
...
...
@@ -22,6 +22,7 @@ import { SignupModalService } from '../../../modules/modals/signup/service';
import
{
OverlayModalService
}
from
'
../../../services/ux/overlay-modal
'
;
import
{
ProUnsubscribeModalComponent
}
from
'
./unsubscribe-modal/modal.component
'
;
import
{
OverlayModalComponent
}
from
'
../../../common/components/overlay-modal/overlay-modal.component
'
;
import
{
SessionsStorageService
}
from
"
../../../services/session-storage.service
"
;
@
Component
({
providers
:
[
ProChannelService
,
OverlayModalService
],
...
...
@@ -66,6 +67,7 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
protected
cd
:
ChangeDetectorRef
,
protected
modal
:
SignupModalService
,
protected
modalService
:
OverlayModalService
,
protected
sessionStorage
:
SessionsStorageService
,
protected
injector
:
Injector
,
)
{}
...
...
@@ -91,7 +93,7 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
.
setContainer
(
this
.
overlayModal
)
.
setRoot
(
this
.
element
.
nativeElement
);
if
(
sessionStorage
.
getItem
(
'
pro::wire-modal::open
'
))
{
if
(
this
.
sessionStorage
.
get
(
'
pro::wire-modal::open
'
))
{
this
.
wire
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.service.ts
View file @
508f2919
...
...
@@ -8,6 +8,7 @@ import { OverlayModalService } from '../../../services/ux/overlay-modal';
import
{
Session
}
from
'
../../../services/session
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
WireCreatorComponent
}
from
'
../../wire/creator/creator.component
'
;
import
{
SessionsStorageService
}
from
"
../../../services/session-storage.service
"
;
export
type
RouterLinkToType
=
|
'
home
'
...
...
@@ -42,6 +43,7 @@ export class ProChannelService {
protected
session
:
Session
,
protected
route
:
ActivatedRoute
,
protected
modalService
:
OverlayModalService
,
protected
sessionStorage
:
SessionsStorageService
,
)
{}
async
load
(
id
:
string
)
{
...
...
@@ -276,15 +278,15 @@ export class ProChannelService {
}
wire
()
{
sessionStorage
.
setItem
(
'
pro::wire-modal::open
'
,
'
1
'
);
this
.
sessionStorage
.
set
(
'
pro::wire-modal::open
'
,
'
1
'
);
this
.
modalService
.
create
(
WireCreatorComponent
,
this
.
currentChannel
,
{
onComplete
:
()
=>
{
sessionStorage
.
removeItem
(
'
pro::wire-modal::open
'
)
this
.
sessionStorage
.
destroy
(
'
pro::wire-modal::open
'
)
},
})
.
onDidDismiss
(()
=>
{
sessionStorage
.
removeItem
(
'
pro::wire-modal::open
'
)
this
.
sessionStorage
.
destroy
(
'
pro::wire-modal::open
'
)
})
.
present
();
}
...
...
This diff is collapsed.
Click to expand it.
src/app/services/providers.ts
View file @
508f2919
import
{
NgZone
,
RendererFactory2
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
Location
}
from
'
@angular/common
'
;
import
{
Title
}
from
'
@angular/platform-browser
'
;
...
...
@@ -44,6 +44,7 @@ import { ThemeService } from '../common/services/theme.service';
import
{
GlobalScrollService
}
from
'
./ux/global-scroll.service
'
;
import
{
AuthService
}
from
'
./auth.service
'
;
import
{
SiteService
}
from
'
./site.service
'
;
import
{
SessionsStorageService
}
from
"
./session-storage.service
"
;
export
const
MINDS_PROVIDERS
:
any
[]
=
[
{
...
...
@@ -76,6 +77,11 @@ export const MINDS_PROVIDERS: any[] = [
useFactory
:
Storage
.
_
,
deps
:
[],
},
{
provide
:
SessionsStorageService
,
useFactory
:
SessionsStorageService
.
_
,
deps
:
[],
},
{
provide
:
SignupModalService
,
useFactory
:
SignupModalService
.
_
,
...
...
This diff is collapsed.
Click to expand it.
src/app/services/session-storage.service.ts
0 → 100644
View file @
508f2919
export
class
SessionsStorageService
{
static
_
()
{
return
new
SessionsStorageService
();
}
get
(
key
:
string
)
{
return
window
.
sessionStorage
.
getItem
(
key
);
}
set
(
key
:
string
,
value
:
any
)
{
return
window
.
sessionStorage
.
setItem
(
key
,
value
);
}
destroy
(
key
:
string
)
{
return
window
.
sessionStorage
.
removeItem
(
key
);
}
}
This diff is collapsed.
Click to expand it.
src/app/services/storage.ts
View file @
508f2919
import
{
Injectable
}
from
'
@angular/core
'
;
export
class
Storage
{
static
_
()
{
return
new
Storage
();
...
...
This diff is collapsed.
Click to expand it.
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