use existing helper
This commit is contained in:
parent
dd9184701e
commit
cb06aee1fa
|
|
@ -26,7 +26,7 @@ import type { StackFrame } from '@protocol/channels';
|
||||||
import { CopyToClipboard } from './copyToClipboard';
|
import { CopyToClipboard } from './copyToClipboard';
|
||||||
import { ToolbarButton } from '@web/components/toolbarButton';
|
import { ToolbarButton } from '@web/components/toolbarButton';
|
||||||
import { Toolbar } from '@web/components/toolbar';
|
import { Toolbar } from '@web/components/toolbar';
|
||||||
import { testServerBaseURL } from '../settings';
|
import { filePathToTraceURL } from './uiModeTraceView';
|
||||||
|
|
||||||
export const SourceTab: React.FunctionComponent<{
|
export const SourceTab: React.FunctionComponent<{
|
||||||
stack?: StackFrame[],
|
stack?: StackFrame[],
|
||||||
|
|
@ -74,7 +74,7 @@ export const SourceTab: React.FunctionComponent<{
|
||||||
try {
|
try {
|
||||||
let response = await fetch(`sha1/src@${sha1}.txt`);
|
let response = await fetch(`sha1/src@${sha1}.txt`);
|
||||||
if (response.status === 404)
|
if (response.status === 404)
|
||||||
response = await fetch(new URL(`/trace/file?path=${encodeURIComponent(file)}`, testServerBaseURL));
|
response = await fetch(filePathToTraceURL(file));
|
||||||
if (response.status >= 400)
|
if (response.status >= 400)
|
||||||
source.content = `<Unable to read "${file}">`;
|
source.content = `<Unable to read "${file}">`;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue