mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-04-19 12:57:17 +00:00
fix: storage service injection
Store the board config data per sketch and not per IDE installation. The (Theia) default `StorageService` implementation is workspace-scoped when `@theia/workspace` is part of the final application. Closes #2240 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
ed2d8ad13c
commit
ce02e263ec
@ -1,5 +1,5 @@
|
||||
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
||||
import { LocalStorageService } from '@theia/core/lib/browser/storage-service';
|
||||
import { StorageService } from '@theia/core/lib/browser/storage-service';
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
import { Emitter, Event } from '@theia/core/lib/common/event';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
@ -23,8 +23,11 @@ export class BoardsDataStore implements FrontendApplicationContribution {
|
||||
private readonly boardsService: BoardsService;
|
||||
@inject(NotificationCenter)
|
||||
private readonly notificationCenter: NotificationCenter;
|
||||
@inject(LocalStorageService)
|
||||
private readonly storageService: LocalStorageService;
|
||||
// When `@theia/workspace` is part of the application, the workspace-scoped storage service is the default implementation, and the `StorageService` symbol must be used for the injection.
|
||||
// https://github.com/eclipse-theia/theia/blob/ba3722b04ff91eb6a4af6a571c9e263c77cdd8b5/packages/workspace/src/browser/workspace-frontend-module.ts#L97-L98
|
||||
// In other words, store the data (such as the board configs) per sketch, not per IDE2 installation. https://github.com/arduino/arduino-ide/issues/2240
|
||||
@inject(StorageService)
|
||||
private readonly storageService: StorageService;
|
||||
|
||||
private readonly onChangedEmitter = new Emitter<string[]>();
|
||||
private readonly toDispose = new DisposableCollection(this.onChangedEmitter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user