File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Example/harmony_use_pushy/harmony/entry/src/main/resources/rawfile Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 11{
2- "pushy_build_time" : " 2025-03-08T14:45:35.258Z " ,
2+ "pushy_build_time" : " 2025-03-09T01:57:42.464Z " ,
33 "versionName" : " 1.0.0"
44}
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ export class UpdateContext {
2929 private initPreferences ( ) {
3030 try {
3131 this . preferences = preferences . getPreferencesSync ( this . context , { name :'update' } ) ;
32+ const packageVersion = this . getPackageVersion ( ) ;
33+ const storedVersion = this . preferences . getSync ( 'packageVersion' , '' ) ;
34+ if ( ! storedVersion ) {
35+ this . preferences . putSync ( 'packageVersion' , packageVersion ) ;
36+ this . preferences . flush ( ) ;
37+ } else if ( storedVersion && packageVersion !== storedVersion ) {
38+ this . preferences . clear ( ) ;
39+ this . preferences . putSync ( 'packageVersion' , packageVersion ) ;
40+ this . preferences . flush ( ) ;
41+ this . cleanUp ( ) ;
42+ }
3243 } catch ( e ) {
3344 console . error ( 'Failed to init preferences:' , e ) ;
3445 }
You can’t perform that action at this time.
0 commit comments