@@ -38,6 +38,7 @@ import type {
3838import { classMap } from 'lit-html/directives/class-map.js' ;
3939import { newConfigurePluginEvent , ConfigurePluginEvent } from '@openscd/open-scd/src/plugin.events.js' ;
4040import { newLogEvent } from '@openscd/core/foundation/deprecated/history.js' ;
41+ import packageJson from '../package.json' ;
4142
4243/** The `<open-scd>` custom element is the main entry point of the
4344 * Open Substation Configuration Designer. */
@@ -166,7 +167,8 @@ export class OpenSCD extends LitElement {
166167
167168 connectedCallback ( ) : void {
168169 super . connectedCallback ( ) ;
169- this . loadPlugins ( )
170+ this . checkAppVersion ( ) ;
171+ this . loadPlugins ( ) ;
170172
171173 // TODO: let Lit handle the event listeners, move to render()
172174 this . addEventListener ( 'reset-plugins' , this . resetPlugins ) ;
@@ -423,6 +425,16 @@ get parsedPlugins(): Plugin[] {
423425 } ;
424426 }
425427
428+ private checkAppVersion ( ) : void {
429+ const currentVersion = packageJson . version ;
430+ const storedVersion = localStorage . getItem ( 'appVersion' ) ;
431+
432+ if ( storedVersion !== currentVersion ) {
433+ localStorage . setItem ( 'appVersion' , currentVersion ) ;
434+ localStorage . removeItem ( 'plugins' ) ;
435+ }
436+ }
437+
426438 @state ( ) private loadedPlugins = new Set < string > ( ) ;
427439
428440 // PLUGGING INTERFACES
0 commit comments