Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
Applications
Systems Frontend
Commits
461ad869
Commit
461ad869
authored
Oct 31, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce redundancy
parent
3e255fbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
src/store/modules/metadata.js
src/store/modules/metadata.js
+4
-11
No files found.
src/store/modules/metadata.js
View file @
461ad869
...
...
@@ -45,17 +45,7 @@ const metadata = {
}
}
if
(
payload
.
id
)
{
const
titleQuery
=
{
'
target.id
'
:
typeof
payload
===
'
string
'
?
`
${
BASE_URI
}
/annotations/
${
payload
}
`
:
payload
.
id
,
'
body.purpose
'
:
'
describing
'
,
'
body.type
'
:
'
TextualBody
'
}
const
titleResult
=
await
context
.
dispatch
(
'
annotations/find
'
,
titleQuery
,
{
root
:
true
})
if
(
titleResult
&&
titleResult
.
items
&&
titleResult
.
items
.
length
)
{
metadata
.
titleAnnotation
=
titleResult
.
items
[
0
]
if
(
metadata
.
title
)
metadata
.
originalTitle
=
metadata
.
title
metadata
.
title
=
titleResult
.
items
[
0
].
body
.
value
}
metadata
=
await
this
.
fetchTitle
(
metadata
,
payload
)
}
console
.
debug
(
'
metadata
'
,
metadata
)
return
metadata
...
...
@@ -69,6 +59,9 @@ const metadata = {
}
let
metadata
metadata
=
context
.
state
.
cache
[
payload
.
body
.
source
.
id
]
||
{}
return
this
.
fetchTitle
(
context
,
metadata
,
payload
)
},
async
fetchTitle
(
context
,
metadata
,
payload
)
{
const
titleQuery
=
{
'
target.id
'
:
typeof
payload
===
'
string
'
?
`
${
BASE_URI
}
/annotations/
${
payload
}
`
:
payload
.
id
,
'
body.purpose
'
:
'
describing
'
,
...
...
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