Skip to content

TagSpaces is an offline, open source, document manager with tagging support

feat: new more concrete updates check

Ilian Sapundshiev512113257465
diff --git a/app/components/dialogs/AboutDialog.tsx b/app/components/dialogs/AboutDialog.tsx
index c146766cb..0aafafdb3 100644
--- a/app/components/dialogs/AboutDialog.tsx
+++ b/app/components/dialogs/AboutDialog.tsx
@@ -117,7 +117,7 @@ const AboutDialog = (props: Props) => {
'Build on: ' +
versionMeta.buildTime +
'\nPlatform: ' +
- navigator.appVersion
+ navigator.userAgent
}
>
<Typography variant="subtitle1">
diff --git a/app/config.ts b/app/config.ts
index cd5202ec6..c4b3f1cd9 100644
--- a/app/config.ts
+++ b/app/config.ts
@@ -47,9 +47,10 @@ export const AppConfig = {
// maxSearchResult: 1000,
defaultFileColor: '#808080',
defaultFolderColor: '#582727', // 555 transparent #FDEEBD #ff791b #2c001e #880e4f
- isElectron: navigator.userAgent.toLowerCase().indexOf(' electron/') > -1,
+ isElectron: navigator.userAgent.toLowerCase().includes(' electron/'),
isFirefox: navigator.userAgent.toLowerCase().includes('firefox'), // typeof InstallTrigger !== 'undefined';
- isWin: navigator.appVersion.includes('Win'),
+ isWin: navigator.userAgent.toLowerCase().includes('win'),
+ isLinux: navigator.userAgent.toLowerCase().includes('linux'),
isMacLike: navigator.userAgent.match(/(Mac|iPhone|iPod|iPad)/i),
isIOS,
isAndroid,
diff --git a/app/links.ts b/app/links.ts
index 44d52ed17..abe35bec2 100644
--- a/app/links.ts
+++ b/app/links.ts
@@ -17,7 +17,7 @@
*/
export const Links = {
links: {
- checkNewVersionURL: 'https://www.tagspaces.org/releases/tagspaces.json',
+ checkNewVersionURL: 'https://updates.tagspaces.org/releases/',
productsOverview: 'https://www.tagspaces.org/products/',
productProObjectStore:
'https://www.tagspaces.org/products/pro/#connectingObjectStorage',
diff --git a/app/reducers/settings.ts b/app/reducers/settings.ts
index 25eadc442..a5330d069 100644
--- a/app/reducers/settings.ts
+++ b/app/reducers/settings.ts
@@ -26,6 +26,7 @@ import Links from '-/links';
import versionMeta from '-/version.json';
import { actions as AppActions } from './app';
import { TS } from '-/tagspaces.namespace';
+import { Pro } from '../pro';
export const types = {
UPGRADE_SETTINGS: 'SETTINGS/UPGRADE_SETTINGS',
@@ -583,8 +584,24 @@ export function getLastVersionPromise(): Promise<string> {
return new Promise((resolve, reject) => {
console.log('Checking for new version...');
const xhr = new XMLHttpRequest();
+ let versionFile = 'tagspaces.json';
+ const proText = Pro ? 'pro-' : '';
+ if (AppConfig.isWeb) {
+ versionFile = 'tagspaces-pro-web.json';
+ } else if (AppConfig.isWin) {
+ versionFile = 'tagspaces-' + proText + 'win-x64.json';
+ } else if (AppConfig.isMacLike) {
+ versionFile = 'tagspaces-' + proText + 'mac.json';
+ } else if (AppConfig.isLinux) {
+ versionFile = 'tagspaces-' + proText + 'linux-x64.json';
+ } else if (AppConfig.isAndroid) {
+ versionFile = 'tagspaces-' + proText + 'android.json';
+ }
const updateUrl =
- Links.links.checkNewVersionURL + '?cv=' + versionMeta.version;
+ Links.links.checkNewVersionURL +
+ versionFile +
+ '?cv=' +
+ versionMeta.version;
xhr.open('GET', updateUrl, true);
xhr.responseType = 'json';
xhr.onerror = reject;