From 891de1ae353dae03f7246d5c1b47a7fa1d66473e Mon Sep 17 00:00:00 2001 From: Saschl <19493808+Saschl@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:15:53 +0200 Subject: [PATCH 01/13] feat: read config json from home dir --- src/renderer/components/LocalApiConfigEditUI/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index 5265eade..bec60121 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -2,6 +2,7 @@ import React, { FC, useEffect, useState } from 'react'; import * as print from 'pdf-to-printer'; import { PromptModal, useModals } from '../Modal'; import { Button, ButtonType } from '../Button'; +import { homedir } from 'os'; import fs from 'fs'; import path from 'path'; import { Directories } from 'renderer/utils/Directories'; @@ -41,7 +42,7 @@ class LocalApiConfigurationHandler { } private static get simbridgeConfigPath(): string { - return path.join(this.simbridgeDirectory, 'resources', 'properties.json'); + return path.join(homedir(), 'resources', 'properties.json'); } static getConfiguration(): LocalApiConfiguration { From f8e9e90dd8527a36c7a3dce8c947674167654739 Mon Sep 17 00:00:00 2001 From: Saschl <19493808+Saschl@users.noreply.github.com> Date: Mon, 30 Sep 2024 09:18:05 +0200 Subject: [PATCH 02/13] fix --- src/renderer/components/LocalApiConfigEditUI/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index bec60121..8bc92213 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -8,7 +8,7 @@ import path from 'path'; import { Directories } from 'renderer/utils/Directories'; import { Toggle } from '../Toggle'; -const SIMBRIDGE_DIRECTORY = 'flybywire-externaltools-simbridge'; +const SIMBRIDGE_DIRECTORY = '/flybywire-externaltools-simbridge'; interface LocalApiConfiguration { server: { @@ -42,7 +42,7 @@ class LocalApiConfigurationHandler { } private static get simbridgeConfigPath(): string { - return path.join(homedir(), 'resources', 'properties.json'); + return path.join(homedir(), SIMBRIDGE_DIRECTORY, 'resources', 'properties.json'); } static getConfiguration(): LocalApiConfiguration { From f35261216c7be1db8b23b44118c7e5aa2fa67296 Mon Sep 17 00:00:00 2001 From: Saschl <19493808+Saschl@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:32:05 +0200 Subject: [PATCH 03/13] use documents folder --- src/renderer/components/LocalApiConfigEditUI/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index 8bc92213..1db9ceac 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -2,13 +2,13 @@ import React, { FC, useEffect, useState } from 'react'; import * as print from 'pdf-to-printer'; import { PromptModal, useModals } from '../Modal'; import { Button, ButtonType } from '../Button'; -import { homedir } from 'os'; +import app from 'electron'; import fs from 'fs'; import path from 'path'; import { Directories } from 'renderer/utils/Directories'; import { Toggle } from '../Toggle'; -const SIMBRIDGE_DIRECTORY = '/flybywire-externaltools-simbridge'; +const SIMBRIDGE_DIRECTORY = '/FlyByWireSim/Simbridge'; interface LocalApiConfiguration { server: { @@ -42,7 +42,7 @@ class LocalApiConfigurationHandler { } private static get simbridgeConfigPath(): string { - return path.join(homedir(), SIMBRIDGE_DIRECTORY, 'resources', 'properties.json'); + return path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY, 'resources', 'properties.json'); } static getConfiguration(): LocalApiConfiguration { @@ -53,7 +53,7 @@ class LocalApiConfigurationHandler { } else { console.log(`No configuration found at ${this.simbridgeConfigPath}`); - if (fs.existsSync(path.join(this.simbridgeDirectory, 'resources'))) { + if (fs.existsSync(path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY, 'resources'))) { console.log(`Creating configuration at ${this.simbridgeConfigPath}`); fs.writeFileSync(path.join(this.simbridgeConfigPath), JSON.stringify(localApiDefaultConfiguration)); From df81a385bbae7d14c97df019cfe00a826cc44ff3 Mon Sep 17 00:00:00 2001 From: Saschl Date: Mon, 30 Sep 2024 20:59:03 +0200 Subject: [PATCH 04/13] fix: use correct import --- src/renderer/components/LocalApiConfigEditUI/index.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index 1db9ceac..23bc7b34 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -2,11 +2,10 @@ import React, { FC, useEffect, useState } from 'react'; import * as print from 'pdf-to-printer'; import { PromptModal, useModals } from '../Modal'; import { Button, ButtonType } from '../Button'; -import app from 'electron'; import fs from 'fs'; import path from 'path'; -import { Directories } from 'renderer/utils/Directories'; import { Toggle } from '../Toggle'; +import { app } from '@electron/remote'; const SIMBRIDGE_DIRECTORY = '/FlyByWireSim/Simbridge'; @@ -38,11 +37,11 @@ const localApiDefaultConfiguration: LocalApiConfiguration = { class LocalApiConfigurationHandler { private static get simbridgeDirectory(): string { - return path.join(Directories.inInstallLocation(SIMBRIDGE_DIRECTORY)); + return path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY); } private static get simbridgeConfigPath(): string { - return path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY, 'resources', 'properties.json'); + return path.join(this.simbridgeDirectory, 'resources', 'properties.json'); } static getConfiguration(): LocalApiConfiguration { @@ -53,7 +52,7 @@ class LocalApiConfigurationHandler { } else { console.log(`No configuration found at ${this.simbridgeConfigPath}`); - if (fs.existsSync(path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY, 'resources'))) { + if (fs.existsSync(path.join(this.simbridgeDirectory, 'resources'))) { console.log(`Creating configuration at ${this.simbridgeConfigPath}`); fs.writeFileSync(path.join(this.simbridgeConfigPath), JSON.stringify(localApiDefaultConfiguration)); From 2660e894acd1127aa8e8425b94f02cf9c416857d Mon Sep 17 00:00:00 2001 From: Saschl Date: Mon, 30 Sep 2024 21:36:02 +0200 Subject: [PATCH 05/13] fix: resources shortcut --- src/renderer/components/AddonSection/MyInstall/index.tsx | 2 ++ src/renderer/data.ts | 4 ++-- src/renderer/utils/Directories.ts | 4 ++++ src/renderer/utils/InstallerConfiguration.ts | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/AddonSection/MyInstall/index.tsx b/src/renderer/components/AddonSection/MyInstall/index.tsx index 533725cb..0490a48b 100644 --- a/src/renderer/components/AddonSection/MyInstall/index.tsx +++ b/src/renderer/components/AddonSection/MyInstall/index.tsx @@ -49,6 +49,8 @@ export const MyInstall: FC = ({ addon }) => { return Directories.inInstallPackage(addon, def.location.path); case 'packageCache': return Directories.inPackageCache(addon, def.location.path); + case 'documents': + return Directories.inDocumentsFolder(def.location.path); } }; diff --git a/src/renderer/data.ts b/src/renderer/data.ts index 8a30659a..77727988 100644 --- a/src/renderer/data.ts +++ b/src/renderer/data.ts @@ -363,8 +363,8 @@ export const defaultConfiguration: Configuration = { directories: [ { location: { - in: 'package', - path: 'resources', + in: 'documents', + path: 'FlyByWireSim/Simbridge/resources', }, title: 'Resources', }, diff --git a/src/renderer/utils/Directories.ts b/src/renderer/utils/Directories.ts index 0feb7a2b..fed9fbed 100644 --- a/src/renderer/utils/Directories.ts +++ b/src/renderer/utils/Directories.ts @@ -141,4 +141,8 @@ export class Directories { return false; } } + + static inDocumentsFolder(targetDir: string): string { + return path.join(app.getPath('documents'), this.sanitize(targetDir)); + } } diff --git a/src/renderer/utils/InstallerConfiguration.ts b/src/renderer/utils/InstallerConfiguration.ts index 1ce3a55d..e1ce2363 100644 --- a/src/renderer/utils/InstallerConfiguration.ts +++ b/src/renderer/utils/InstallerConfiguration.ts @@ -8,7 +8,7 @@ export interface ExternalLink { export interface DirectoryDefinition { location: { - in: 'community' | 'packageCache' | 'package'; + in: 'community' | 'packageCache' | 'package' | 'documents'; path: string; }; } @@ -354,7 +354,7 @@ export interface Configuration { export class InstallerConfiguration { static async obtain(): Promise { - return this.fetchConfigurationFromCdn() + return this.loadConfigurationFromLocalStorage() .then((config) => { if (this.isConfigurationValid(config)) { console.log('Configuration from CDN is valid'); From 92a772ec77c345758d6e7d25f03285c912f290bd Mon Sep 17 00:00:00 2001 From: Saschl Date: Sat, 5 Oct 2024 20:42:46 +0200 Subject: [PATCH 06/13] revert unwanted change --- src/renderer/utils/InstallerConfiguration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/utils/InstallerConfiguration.ts b/src/renderer/utils/InstallerConfiguration.ts index e1ce2363..4f1f821f 100644 --- a/src/renderer/utils/InstallerConfiguration.ts +++ b/src/renderer/utils/InstallerConfiguration.ts @@ -354,7 +354,7 @@ export interface Configuration { export class InstallerConfiguration { static async obtain(): Promise { - return this.loadConfigurationFromLocalStorage() + return this.fetchConfigurationFromCdn() .then((config) => { if (this.isConfigurationValid(config)) { console.log('Configuration from CDN is valid'); From 8bae78a56e00a06d2d694829be14ae998cde8edd Mon Sep 17 00:00:00 2001 From: Saschl Date: Tue, 8 Oct 2024 10:07:20 +0200 Subject: [PATCH 07/13] enable temporary warning text for simbridge --- package-lock.json | 555 +++++++++++++++++- package.json | 1 + .../AddonSection/Configure/index.tsx | 2 + src/renderer/data.ts | 3 +- 4 files changed, 557 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c13f897..2aa17d04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "react-router-dom": "^5.2.0", "react-windows-controls": "^1.1.1", "redux": "^4.0.5", + "rehype-raw": "^7.0.0", "remark-gfm": "^2.0.0", "semver": "7.3.5", "simplebar-react": "^3.2.4", @@ -4920,8 +4921,7 @@ "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", @@ -7973,6 +7973,18 @@ "node": ">=0.8.0" } }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/dezalgo": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", @@ -10759,6 +10771,360 @@ "node": ">= 0.4" } }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.1.tgz", + "integrity": "sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^8.0.0", + "property-information": "^6.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/hast-util-from-parse5/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" + }, + "node_modules/hast-util-from-parse5/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/hast-util-raw": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.0.4.tgz", + "integrity": "sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/hast-util-raw/node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/hast-util-raw/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" + }, + "node_modules/hast-util-raw/node_modules/mdast-util-to-hast": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz", + "integrity": "sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/micromark-util-character": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.0.tgz", + "integrity": "sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/hast-util-raw/node_modules/micromark-util-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.0.tgz", + "integrity": "sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/hast-util-raw/node_modules/micromark-util-sanitize-uri": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.0.tgz", + "integrity": "sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/hast-util-raw/node_modules/micromark-util-symbol": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.0.tgz", + "integrity": "sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/hast-util-raw/node_modules/micromark-util-types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.0.tgz", + "integrity": "sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/hast-util-raw/node_modules/unist-util-is": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.0.tgz", + "integrity": "sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/unist-util-visit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz", + "integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/unist-util-visit-parents": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz", + "integrity": "sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", + "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-parse5/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/hast-util-whitespace": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", @@ -10768,6 +11134,30 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hastscript": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-8.0.0.tgz", + "integrity": "sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^6.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -10939,6 +11329,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/html-webpack-plugin": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.0.tgz", @@ -14939,6 +15338,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -18327,6 +18748,71 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw/node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/rehype-raw/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" + }, + "node_modules/rehype-raw/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -21149,6 +21635,62 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/vfile-location": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz", + "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==" + }, + "node_modules/vfile-location/node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location/node_modules/vfile-message": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz", + "integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vfile-message": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", @@ -21282,6 +21824,15 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index affe1ba9..0d39d9f6 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "react-router-dom": "^5.2.0", "react-windows-controls": "^1.1.1", "redux": "^4.0.5", + "rehype-raw": "^7.0.0", "remark-gfm": "^2.0.0", "semver": "7.3.5", "simplebar-react": "^3.2.4", diff --git a/src/renderer/components/AddonSection/Configure/index.tsx b/src/renderer/components/AddonSection/Configure/index.tsx index ffe6af7f..282a4089 100644 --- a/src/renderer/components/AddonSection/Configure/index.tsx +++ b/src/renderer/components/AddonSection/Configure/index.tsx @@ -6,6 +6,7 @@ import { Track, Tracks } from './TrackSelector'; import { ConfigurationAspectDisplay } from 'renderer/components/AddonSection/Configure/ConfigurationAspectDisplay'; import './index.css'; +import rehypeRaw from 'rehype-raw'; export interface ConfigureProps { routeAspectKey: string; @@ -76,6 +77,7 @@ export const Configure: FC = ({ {selectedTrack.description} diff --git a/src/renderer/data.ts b/src/renderer/data.ts index 77727988..a563b38d 100644 --- a/src/renderer/data.ts +++ b/src/renderer/data.ts @@ -343,8 +343,7 @@ export const defaultConfiguration: Configuration = { }, url: 'https://cdn.flybywiresim.com/addons/simbridge/release/', isExperimental: false, - description: - 'SimBridge is an external app that enables FlyByWire Simulations aircraft to communicate outside your simulator. From remote displays to external terrain display rendering, it is used for a variety of optional features.', + description: `⚠ Note: Starting with version 0.6.0 custom resources like PDF Charts and Company Routes need to be located inside the Documents folder. Please refer to the documentation. \n\n SimBridge is an external app that enables FlyByWire Simulations aircraft to communicate outside your simulator. From remote displays to external terrain display rendering, it is used for a variety of optional features.`, }, ], disallowedRunningExternalApps: ['@/simbridge-app'], From f059da19cbdd4a4a60a0b311158f75c2b8465b29 Mon Sep 17 00:00:00 2001 From: Saschl Date: Wed, 9 Oct 2024 08:42:41 +0200 Subject: [PATCH 08/13] fix: allow backwards compatibility --- .../components/LocalApiConfigEditUI/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index 23bc7b34..cb2bed53 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -6,7 +6,9 @@ import fs from 'fs'; import path from 'path'; import { Toggle } from '../Toggle'; import { app } from '@electron/remote'; +import { Directories } from 'renderer/utils/Directories'; +const LEGACY_SIMBRIDGE_DIRECTORY = 'flybywire-externaltools-simbridge'; const SIMBRIDGE_DIRECTORY = '/FlyByWireSim/Simbridge'; interface LocalApiConfiguration { @@ -36,12 +38,21 @@ const localApiDefaultConfiguration: LocalApiConfiguration = { }; class LocalApiConfigurationHandler { + private static get legacySimbridgeDirectory(): string { + return path.join(Directories.inInstallLocation(SIMBRIDGE_DIRECTORY)); + } + private static get simbridgeDirectory(): string { return path.join(app.getPath('documents'), SIMBRIDGE_DIRECTORY); } private static get simbridgeConfigPath(): string { - return path.join(this.simbridgeDirectory, 'resources', 'properties.json'); + const configPath = path.join(this.simbridgeDirectory, 'resources', 'properties.json'); + if (fs.existsSync(configPath)) { + return configPath; + } + // TODO remove this after a while once simbridge is released + return path.join(this.legacySimbridgeDirectory, 'resources', 'properties.json'); } static getConfiguration(): LocalApiConfiguration { From 816c3a04ea5a492bcaf43704bcf36cb4bedd330e Mon Sep 17 00:00:00 2001 From: Saschl Date: Wed, 9 Oct 2024 08:45:55 +0200 Subject: [PATCH 09/13] fix typo --- src/renderer/components/LocalApiConfigEditUI/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/LocalApiConfigEditUI/index.tsx b/src/renderer/components/LocalApiConfigEditUI/index.tsx index cb2bed53..4335aab1 100644 --- a/src/renderer/components/LocalApiConfigEditUI/index.tsx +++ b/src/renderer/components/LocalApiConfigEditUI/index.tsx @@ -39,7 +39,7 @@ const localApiDefaultConfiguration: LocalApiConfiguration = { class LocalApiConfigurationHandler { private static get legacySimbridgeDirectory(): string { - return path.join(Directories.inInstallLocation(SIMBRIDGE_DIRECTORY)); + return path.join(Directories.inInstallLocation(LEGACY_SIMBRIDGE_DIRECTORY)); } private static get simbridgeDirectory(): string { From 22e685ed40154d97fa82e314ddf7a97b1e2d220a Mon Sep 17 00:00:00 2001 From: Saschl Date: Wed, 9 Oct 2024 14:37:22 +0200 Subject: [PATCH 10/13] fix: enable html rendering on addon description --- src/renderer/components/AddonSection/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/AddonSection/index.tsx b/src/renderer/components/AddonSection/index.tsx index 0a177d26..c3fa2f19 100644 --- a/src/renderer/components/AddonSection/index.tsx +++ b/src/renderer/components/AddonSection/index.tsx @@ -28,6 +28,7 @@ import { InstallManager } from 'renderer/utils/InstallManager'; import { StateSection } from 'renderer/components/AddonSection/StateSection'; import { ExternalApps } from 'renderer/utils/ExternalApps'; import { MyInstall } from 'renderer/components/AddonSection/MyInstall'; +import rehypeRaw from 'rehype-raw'; const abortControllers = new Array(20); abortControllers.fill(new AbortController()); @@ -537,7 +538,11 @@ const About: FC<{ addon: Addon }> = ({ addon }) => (

{addon.aircraftName}

- + {addon.description} From 38804beb07655696d238489b2db6d9ff35f27a84 Mon Sep 17 00:00:00 2001 From: Saschl Date: Mon, 14 Oct 2024 18:57:00 +0200 Subject: [PATCH 11/13] fix: use old simbridge configuration automatically if new one not present --- src/renderer/components/AddonSection/MyInstall/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/AddonSection/MyInstall/index.tsx b/src/renderer/components/AddonSection/MyInstall/index.tsx index 0490a48b..17325b1e 100644 --- a/src/renderer/components/AddonSection/MyInstall/index.tsx +++ b/src/renderer/components/AddonSection/MyInstall/index.tsx @@ -50,7 +50,13 @@ export const MyInstall: FC = ({ addon }) => { case 'packageCache': return Directories.inPackageCache(addon, def.location.path); case 'documents': - return Directories.inDocumentsFolder(def.location.path); + const documents = Directories.inDocumentsFolder(def.location.path); + if (fs.existsSync(documents)) { + return documents; + } + // fallback for simbridge installations prior to 0.6 + // remove afer transition period + return Directories.inInstallPackage(addon, 'resources'); } }; From c54a04662679147ce27c92464629636d9b78fcf7 Mon Sep 17 00:00:00 2001 From: Saschl Date: Mon, 14 Oct 2024 19:26:56 +0200 Subject: [PATCH 12/13] fix lint --- src/renderer/components/AddonSection/MyInstall/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/AddonSection/MyInstall/index.tsx b/src/renderer/components/AddonSection/MyInstall/index.tsx index 17325b1e..7c452771 100644 --- a/src/renderer/components/AddonSection/MyInstall/index.tsx +++ b/src/renderer/components/AddonSection/MyInstall/index.tsx @@ -49,7 +49,7 @@ export const MyInstall: FC = ({ addon }) => { return Directories.inInstallPackage(addon, def.location.path); case 'packageCache': return Directories.inPackageCache(addon, def.location.path); - case 'documents': + case 'documents': { const documents = Directories.inDocumentsFolder(def.location.path); if (fs.existsSync(documents)) { return documents; @@ -57,6 +57,7 @@ export const MyInstall: FC = ({ addon }) => { // fallback for simbridge installations prior to 0.6 // remove afer transition period return Directories.inInstallPackage(addon, 'resources'); + } } }; From 03e391fceb196b1b4fea6d70b60fa478c29c1a68 Mon Sep 17 00:00:00 2001 From: Saschl Date: Mon, 14 Oct 2024 19:27:11 +0200 Subject: [PATCH 13/13] fix typo --- src/renderer/components/AddonSection/MyInstall/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/components/AddonSection/MyInstall/index.tsx b/src/renderer/components/AddonSection/MyInstall/index.tsx index 7c452771..18bc461d 100644 --- a/src/renderer/components/AddonSection/MyInstall/index.tsx +++ b/src/renderer/components/AddonSection/MyInstall/index.tsx @@ -55,7 +55,7 @@ export const MyInstall: FC = ({ addon }) => { return documents; } // fallback for simbridge installations prior to 0.6 - // remove afer transition period + // remove after transition period return Directories.inInstallPackage(addon, 'resources'); } }