Skip to content

Commit

Permalink
Fix loss of local storage in Electron
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Westbury <[email protected]>
  • Loading branch information
westbury committed Oct 3, 2019
1 parent 74d3790 commit 85af2b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/browser/storage-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { inject, injectable, postConstruct } from 'inversify';
import { ILogger } from '../common/logger';
import { MessageService } from '../common/message-service';
import { WindowService } from './window/window-service';
import { environment } from '@theia/application-package/lib/environment';

export const StorageService = Symbol('IStorageService');
/**
Expand Down Expand Up @@ -83,6 +84,9 @@ export class LocalStorageService implements StorageService {
}

protected prefix(key: string): string {
if (environment.electron.is()) {
return `theia:${key}`;
}
const pathname = typeof window === 'undefined' ? '' : window.location.pathname;
return `theia:${pathname}:${key}`;
}
Expand Down

0 comments on commit 85af2b0

Please sign in to comment.