Skip to content

Commit

Permalink
allow fallback roaming data path when user path isn't supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Sep 14, 2024
1 parent a52791b commit 0a953dd
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,12 @@ export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvi
@memoize
// -- Start PWB: Local storage ---
get userRoamingDataHome(): URI {
return isWeb ?
joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User') :
// In a web context, derive the user data path from the `userDataPath`
// option if provided (always used on PWB)
return isWeb && this.options.userDataPath ?
joinPath(URI.file(this.options.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User') :
URI.file('/User').with({ scheme: Schemas.vscodeUserData });
}

get userDataPath(): string {
if (!this.options.userDataPath) {
throw new Error('userDataPath was not provided to the browser');
}
return this.options.userDataPath;
}
// --- End PWB ---

// --- Start PWB: disable file downloads ---
Expand Down

0 comments on commit 0a953dd

Please sign in to comment.