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
eabf7f89
Commit
eabf7f89
authored
May 18, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
May 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ThreadsService to TS
parent
2b8b9411
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
tags.ts
src/sidebar/services/tags.ts
+2
-2
threads.ts
src/sidebar/services/threads.ts
+6
-10
No files found.
src/sidebar/services/tags.ts
View file @
eabf7f89
...
...
@@ -68,8 +68,8 @@ export class TagsService {
*/
store
(
tags
:
string
[])
{
// Update the stored (tag, frequency) map.
const
savedTags
:
Record
<
string
,
Tag
>
=
this
.
_storage
.
getObject
(
TAGS_MAP_KEY
)
||
{};
const
savedTags
=
this
.
_storage
.
getObject
<
Record
<
string
,
Tag
>>
(
TAGS_MAP_KEY
)
||
{};
tags
.
forEach
(
tag
=>
{
if
(
savedTags
[
tag
])
{
savedTags
[
tag
].
count
+=
1
;
...
...
src/sidebar/services/threads.
j
s
→
src/sidebar/services/threads.
t
s
View file @
eabf7f89
/**
* @typedef {import('../helpers/build-thread').Thread} Thread
*/
import
type
{
Thread
}
from
'../helpers/build-thread'
;
import
type
{
SidebarStore
}
from
'../store'
;
/**
* A service for performing operations related to the current set of threads.
*/
// @inject
export
class
ThreadsService
{
/**
* @param {import('../store').SidebarStore} store
*/
constructor
(
store
)
{
private
_store
:
SidebarStore
;
constructor
(
store
:
SidebarStore
)
{
this
.
_store
=
store
;
}
...
...
@@ -19,10 +17,8 @@ export class ThreadsService {
* "unhiding" a thread which is currently hidden by an applied search filter
* (as well as its child threads). Only threads that are not currently visible
* will be forced visible.
*
* @param {Thread} thread
*/
forceVisible
(
thread
)
{
forceVisible
(
thread
:
Thread
)
{
thread
.
children
.
forEach
(
child
=>
{
this
.
forceVisible
(
child
);
});
...
...
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