Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
81fba46a
Commit
81fba46a
authored
5 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Remove rejected comments of indexedDB
parent
aeb88f9b
Branches
Branches containing commit
1 merge request
!381
WIP: Resolve "Have a better strategy for sharing data"
Pipeline
#29990
failed with stages
in 1 minute and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/shared/comment-list/comment-list.component.ts
+8
-5
8 additions, 5 deletions
.../components/shared/comment-list/comment-list.component.ts
with
8 additions
and
5 deletions
src/app/components/shared/comment-list/comment-list.component.ts
+
8
−
5
View file @
81fba46a
...
@@ -156,7 +156,6 @@ export class CommentListComponent implements OnInit {
...
@@ -156,7 +156,6 @@ export class CommentListComponent implements OnInit {
c
.
id
=
payload
.
id
;
c
.
id
=
payload
.
id
;
c
.
timestamp
=
payload
.
timestamp
;
c
.
timestamp
=
payload
.
timestamp
;
this
.
addComment
(
c
);
this
.
addComment
(
c
);
this
.
updateComments
();
break
;
break
;
case
'
CommentPatched
'
:
case
'
CommentPatched
'
:
// ToDo: Use a map for comments w/ key = commentId
// ToDo: Use a map for comments w/ key = commentId
...
@@ -166,34 +165,36 @@ export class CommentListComponent implements OnInit {
...
@@ -166,34 +165,36 @@ export class CommentListComponent implements OnInit {
switch
(
key
)
{
switch
(
key
)
{
case
this
.
read
:
case
this
.
read
:
this
.
comments
[
i
].
read
=
<
boolean
>
value
;
this
.
comments
[
i
].
read
=
<
boolean
>
value
;
this
.
updateDatabase
();
break
;
break
;
case
this
.
correct
:
case
this
.
correct
:
this
.
comments
[
i
].
correct
=
<
boolean
>
value
;
this
.
comments
[
i
].
correct
=
<
boolean
>
value
;
this
.
updateDatabase
();
break
;
break
;
case
this
.
favorite
:
case
this
.
favorite
:
this
.
comments
[
i
].
favorite
=
<
boolean
>
value
;
this
.
comments
[
i
].
favorite
=
<
boolean
>
value
;
this
.
updateDatabase
();
break
;
break
;
case
'
score
'
:
case
'
score
'
:
this
.
comments
[
i
].
score
=
<
number
>
value
;
this
.
comments
[
i
].
score
=
<
number
>
value
;
this
.
updateDatabase
();
break
;
break
;
case
this
.
ack
:
case
this
.
ack
:
const
isNowAck
=
<
boolean
>
value
;
const
isNowAck
=
<
boolean
>
value
;
if
(
!
isNowAck
)
{
if
(
!
isNowAck
)
{
this
.
comments
=
this
.
comments
.
filter
(
function
(
el
)
{
this
.
deleteComment
(
payload
.
id
);
return
el
.
id
!==
payload
.
id
;
});
}
}
}
}
}
}
}
}
}
}
this
.
updateDatabase
();
break
;
break
;
case
'
CommentHighlighted
'
:
case
'
CommentHighlighted
'
:
// ToDo: Use a map for comments w/ key = commentId
// ToDo: Use a map for comments w/ key = commentId
for
(
let
i
=
0
;
i
<
this
.
comments
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
comments
.
length
;
i
++
)
{
if
(
payload
.
id
===
this
.
comments
[
i
].
id
)
{
if
(
payload
.
id
===
this
.
comments
[
i
].
id
)
{
this
.
comments
[
i
].
highlighted
=
<
boolean
>
payload
.
lights
;
this
.
comments
[
i
].
highlighted
=
<
boolean
>
payload
.
lights
;
this
.
updateDatabase
();
}
}
}
}
break
;
break
;
...
@@ -227,10 +228,12 @@ export class CommentListComponent implements OnInit {
...
@@ -227,10 +228,12 @@ export class CommentListComponent implements OnInit {
addComment
(
comment
:
Comment
):
void
{
addComment
(
comment
:
Comment
):
void
{
this
.
databaseService
.
comments
.
add
(
comment
);
this
.
databaseService
.
comments
.
add
(
comment
);
this
.
updateComments
();
}
}
deleteComment
(
id
:
string
)
{
deleteComment
(
id
:
string
)
{
this
.
databaseService
.
comments
.
delete
(
id
);
this
.
databaseService
.
comments
.
delete
(
id
);
this
.
updateComments
();
}
}
async
updateComments
()
{
async
updateComments
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment