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
e4df4349
Commit
e4df4349
authored
Feb 01, 2022
by
Eduardo Sanz García
Committed by
Eduardo
Feb 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid import aliases
Made some very minor changes to avoid import aliases.
parent
e1408b36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
MarkdownView.js
src/sidebar/components/MarkdownView.js
+2
-2
fetch-config.js
src/sidebar/config/fetch-config.js
+7
-7
No files found.
src/sidebar/components/MarkdownView.js
View file @
e4df4349
...
...
@@ -2,7 +2,7 @@ import classnames from 'classnames';
import
{
useEffect
,
useMemo
,
useRef
}
from
'preact/hooks'
;
import
{
replaceLinksWithEmbeds
}
from
'../media-embedder'
;
import
{
renderMathAndMarkdown
as
renderMarkdown
}
from
'../render-markdown'
;
import
{
renderMathAndMarkdown
}
from
'../render-markdown'
;
/**
* @typedef MarkdownViewProps
...
...
@@ -25,7 +25,7 @@ export default function MarkdownView({
textStyle
=
{},
})
{
const
html
=
useMemo
(
()
=>
(
markdown
?
renderMarkdown
(
markdown
)
:
''
),
()
=>
(
markdown
?
renderMa
thAndMa
rkdown
(
markdown
)
:
''
),
[
markdown
]
);
const
content
=
/** @type {{ current: HTMLDivElement }} */
(
useRef
());
...
...
src/sidebar/config/fetch-config.js
View file @
e4df4349
import
{
getApiUrl
}
from
'./get-api-url'
;
import
{
hostPageConfig
as
hostConfig
}
from
'./host-config'
;
import
{
hostPageConfig
}
from
'./host-config'
;
import
*
as
postMessageJsonRpc
from
'../util/postmessage-json-rpc'
;
/**
...
...
@@ -89,10 +89,10 @@ function fetchConfigFromAncestorFrame(origin, window_ = window) {
* @return {Promise<object>} - The merged settings.
*/
function
fetchConfigLegacy
(
appConfig
,
window_
=
window
)
{
const
host
PageConfig
=
host
Config
(
window_
);
const
host
Config
=
hostPage
Config
(
window_
);
let
embedderConfig
;
const
origin
=
/** @type string */
(
host
Page
Config
.
requestConfigFromFrame
);
const
origin
=
/** @type string */
(
hostConfig
.
requestConfigFromFrame
);
embedderConfig
=
fetchConfigFromAncestorFrame
(
origin
,
window_
);
return
embedderConfig
.
then
(
embedderConfig
=>
{
...
...
@@ -190,13 +190,13 @@ async function fetchGroupsAsync(config, rpcCall) {
* @return {Promise<MergedConfig>} - The merged settings.
*/
export
async
function
fetchConfig
(
appConfig
,
window_
=
window
)
{
const
host
PageConfig
=
host
Config
(
window
);
const
host
Config
=
hostPage
Config
(
window
);
const
requestConfigFromFrame
=
host
Page
Config
.
requestConfigFromFrame
;
const
requestConfigFromFrame
=
hostConfig
.
requestConfigFromFrame
;
if
(
!
requestConfigFromFrame
)
{
// Directly embed: just get the config.
return
fetchConfigEmbed
(
appConfig
,
host
Page
Config
);
return
fetchConfigEmbed
(
appConfig
,
hostConfig
);
}
if
(
typeof
requestConfigFromFrame
===
'string'
)
{
// Legacy: send RPC to all parents to find config. (deprecated)
...
...
@@ -222,7 +222,7 @@ export async function fetchConfig(appConfig, window_ = window) {
// as this is needed in the Notebook.
return
{
...
rpcMergedConfig
,
...(
host
PageConfig
.
group
?
{
group
:
hostPage
Config
.
group
}
:
{}),
...(
host
Config
.
group
?
{
group
:
host
Config
.
group
}
:
{}),
};
}
else
{
throw
new
Error
(
...
...
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