Skip to content

Commit

Permalink
Dev/jwunderl/dont error on empty response (#10185)
Browse files Browse the repository at this point in the history
* dont fail on get undefined

* propagate local_token to time machine
  • Loading branch information
jwunderl authored Sep 13, 2024
1 parent 477b1fe commit 8e0daec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions webapp/src/fileworkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export function setApiAsync(f: (path: string, data?: any) => Promise<any>) {
function getAsync(h: Header) {
return apiAsync("pkg/" + h.path)
.then((resp: pxt.FsPkg) => {
if (!resp.files) {
return undefined;
}
let r: pxt.workspace.File = {
header: h,
text: {},
Expand Down
7 changes: 6 additions & 1 deletion webapp/src/timeMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,14 @@ export const TimeMachine = (props: TimeMachineProps) => {
"controller",
"skillsMap",
"noproject",
"nocookiebanner"
"nocookiebanner",
];

const localToken = pxt.storage.getLocal("local_token");
if (localToken) {
queryParams.push(`local_token=${localToken}`);
}

if (pxt.appTarget?.appTheme.timeMachineQueryParams) {
queryParams = queryParams.concat(pxt.appTarget.appTheme.timeMachineQueryParams);
}
Expand Down

0 comments on commit 8e0daec

Please sign in to comment.