Skip to content

Commit

Permalink
chore: basics for update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Apr 16, 2024
1 parent d6f21a0 commit f3e2605
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()})`);
});
Expand Down
8 changes: 7 additions & 1 deletion src/Generic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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) => {},
Expand Down

0 comments on commit f3e2605

Please sign in to comment.