Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pass web app version to snjs application #623

Merged
merged 12 commits into from
Sep 6, 2021

Conversation

vardan-arm
Copy link
Contributor

No description provided.

@@ -81,6 +83,12 @@ class ApplicationViewCtrl extends PureViewCtrl<unknown, {
await this.application.launch();
}

async setAppVersion() {
const appVersion = packageJson.version;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that, thanks! Will update it.

@vardan-arm vardan-arm changed the title feat (WIP): store web version in local storage feat (WIP): pass web app version to snjs application Sep 1, 2021
@vardan-arm
Copy link
Contributor Author

@@ -25,6 +25,8 @@ import { NativeExtManager } from '@/services/nativeExtManager';
import { StatusManager } from '@/services/statusManager';
import { ThemeManager } from '@/services/themeManager';

declare const __VERSION__: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be imported from somewhere instead? Perhaps we should have a version.ts file that all other files reference if they need to access the version?

Copy link
Contributor Author

@vardan-arm vardan-arm Sep 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice point, moved this and other globals to separate files. Actually my intention was to combine them in one file and do named exports, but only default export works in this case, so created a separate file for every global variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, found a better way, used approach from here.

declare const __DESKTOP__: boolean;
declare const __WEB__: boolean;

export const appVersion = __VERSION__;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I would make these PascalCase to indicate a global constant rather than var or function.

Suggested change
export const appVersion = __VERSION__;
export const AppVersion = __VERSION__;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, will update. Do you think we should make isDesktopPlatform and isWebPlatform Pascal case as well? I think based on their name it's better to keep them camel cased, but I'm open for other opinions :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup same thing for those as well since they are global constants.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated)

@vardan-arm vardan-arm changed the title feat (WIP): pass web app version to snjs application feat: pass web app version to snjs application Sep 2, 2021
@vardan-arm vardan-arm marked this pull request as ready for review September 2, 2021 21:09
@vardan-arm vardan-arm merged commit 041d437 into develop Sep 6, 2021
@vardan-arm vardan-arm deleted the feat/version-in-api-calls branch September 6, 2021 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants