This repository was archived by the owner on May 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -173,18 +173,23 @@ function onExtensionInstalled(details) {
173173 }
174174
175175 var changelog = {
176- "2.0.13" : "Breaking change: please update the host app to at least v2.0.12"
176+ 2012 : "Breaking change: please update the host app to at least v2.0.12"
177177 } ;
178178
179- var version = chrome . runtime . getManifest ( ) . version ;
180- if ( ! ( version in changelog ) ) {
181- return ;
182- }
183-
184- chrome . notifications . create ( version , {
185- title : "browserpass: Important changes" ,
186- message : changelog [ version ] ,
187- iconUrl : "icon-lock.png" ,
188- type : "basic"
189- } ) ;
179+ var parseVersion = version => parseInt ( version . replace ( / \. / g, "" ) ) ;
180+ var newVersion = parseVersion ( chrome . runtime . getManifest ( ) . version ) ;
181+ var prevVersion = parseVersion ( details . previousVersion ) ;
182+
183+ Object . keys ( changelog )
184+ . sort ( )
185+ . forEach ( function ( version ) {
186+ if ( version > prevVersion && version <= newVersion ) {
187+ chrome . notifications . create ( version , {
188+ title : "browserpass: Important changes" ,
189+ message : changelog [ version ] ,
190+ iconUrl : "icon-lock.png" ,
191+ type : "basic"
192+ } ) ;
193+ }
194+ } ) ;
190195}
You can’t perform that action at this time.
0 commit comments