Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trusz committed Dec 15, 2024
1 parent 3891a24 commit 430e749
Show file tree
Hide file tree
Showing 5 changed files with 516 additions and 222 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/openscd/src/open-scd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,7 @@ export class OpenSCD extends LitElement {



private storePlugins(plugins: Array<Plugin | InstalledOfficialPlugin>) {
const pluginConfigs = JSON.stringify(plugins.map(withoutContent))
localStorage.setItem('plugins', pluginConfigs);
}


/**
*
Expand Down Expand Up @@ -328,11 +325,14 @@ export class OpenSCD extends LitElement {
};
})


this.storedPlugins = mergedPlugins;
this.storePlugins(this.storedPlugins);
this.storePlugins(mergedPlugins);
}

private storePlugins(plugins: Plugin[]) {
this.storedPlugins = plugins
const pluginConfigs = JSON.stringify(plugins.map(withoutContent))
localStorage.setItem('plugins', pluginConfigs);
}
private getPluginConfigsFromLocalStorage(): Plugin[] {
const pluginsConfigStr = localStorage.getItem('plugins') ?? '[]'
return JSON.parse(pluginsConfigStr) as Plugin[]
Expand Down
2 changes: 1 addition & 1 deletion packages/openscd/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type Plugin = {
content?: () => TemplateResult;
};

export type InstalledOfficialPlugin = {
export type InstalledOfficialPlugin = Plugin & {
src: string;
official: true;
installed: boolean;
Expand Down
Loading

0 comments on commit 430e749

Please sign in to comment.