diff --git a/App.tsx b/App.tsx index eb6ab7c..8135a99 100644 --- a/App.tsx +++ b/App.tsx @@ -111,6 +111,22 @@ class MainView extends React.Component { console.log(`[APP] Mounted component (${new Date().getTime()})`); let defaultnotif = await createChannel(); console.log(`[NOTIFEE] Created channel: ${defaultnotif}`); + console.log(app.version, app.settings.get('app.lastVersion')); + const lastVersion = app.settings.get('app.lastVersion'); + if (!lastVersion || lastVersion === '') { + console.log( + `[APP] lastVersion is null (${lastVersion}), setting to app.version (${app.version})`, + ); + app.settings.set('app.lastVersion', app.version); + } else { + app.version === lastVersion + ? console.log( + `[APP] lastVersion (${lastVersion}) is equal to app.version (${app.version})`, + ) + : console.log( + `[APP] lastVersion (${lastVersion}) is different from app.version (${app.version})`, + ); + } client.on('connecting', () => { console.log(`[APP] Connecting to instance... (${new Date().getTime()})`); }); diff --git a/src/Generic.tsx b/src/Generic.tsx index fc6aef7..8e09d7a 100644 --- a/src/Generic.tsx +++ b/src/Generic.tsx @@ -97,7 +97,6 @@ export const app = { out.push({key: s.key, value: s.value}); } } - out.push({key: 'app.lastVersion', value: app.version}); AsyncStorage.setItem('settings', JSON.stringify(out)); } catch (err) { console.log(`[SETTINGS] Error saving settings: ${err}`); @@ -283,6 +282,13 @@ export const app = { default: DEFAULT_API_URL, type: 'string', }, + // last ver + { + key: 'app.lastVersion', + category: 'donotshow', + default: '', + type: 'string', + }, ] as Setting[], }, openProfile: (u, s?: Server) => {},