@@ -31,11 +31,21 @@ export const downloadRootDir: string = PushyConstants.downloadRootDir;
3131export const packageVersion : string = PushyConstants . packageVersion ;
3232export const currentVersion : string = PushyConstants . currentVersion ;
3333
34+ export function setLocalHashInfo ( hash : string , info : Record < string , any > ) {
35+ PushyModule . setLocalHashInfo ( hash , JSON . stringify ( info ) ) ;
36+ }
37+
3438const currentVersionInfoString : string = PushyConstants . currentVersionInfo ;
35- let _currentVersionInfo = { } ;
39+ let _currentVersionInfo : Record < string , any > = { } ;
40+ let isDebugChannel = false ;
3641if ( currentVersionInfoString ) {
3742 try {
3843 _currentVersionInfo = JSON . parse ( currentVersionInfoString ) ;
44+ if ( _currentVersionInfo . debugChannel ) {
45+ isDebugChannel = true ;
46+ delete _currentVersionInfo . debugChannel ;
47+ setLocalHashInfo ( currentVersion , _currentVersionInfo ) ;
48+ }
3949 } catch ( error ) {
4050 console . error (
4151 'Failed to parse currentVersionInfo:' ,
@@ -46,15 +56,13 @@ if (currentVersionInfoString) {
4656export const currentVersionInfo = _currentVersionInfo ;
4757
4858export const isFirstTime : boolean = PushyConstants . isFirstTime ;
59+ export const isFirstTimeDebug : boolean = isFirstTime && isDebugChannel ;
4960export const rolledBackVersion : string = PushyConstants . rolledBackVersion ;
5061export const isRolledBack : boolean = ! ! rolledBackVersion ;
5162
5263export const buildTime : string = PushyConstants . buildTime ;
5364let uuid = PushyConstants . uuid ;
5465
55- export function setLocalHashInfo ( hash : string , info : Record < string , any > ) {
56- PushyModule . setLocalHashInfo ( hash , JSON . stringify ( info ) ) ;
57- }
5866
5967async function getLocalHashInfo ( hash : string ) {
6068 return JSON . parse ( await PushyModule . getLocalHashInfo ( hash ) ) ;
0 commit comments