mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 08:39:59 +00:00
Allow patch versions to remain compatible
This commit is contained in:
@@ -39,13 +39,19 @@ Missing/outdated strings:
|
||||
* `optionsMirroringEnabled`
|
||||
* `optionsMirroringAppId`
|
||||
* `popupMediaTypeAppNotFound`
|
||||
* `optionsBridgeCompatible`
|
||||
* `optionsBridgeLikelyCompatible`
|
||||
* `optionsBridgeIncompatible`
|
||||
|
||||
* `es`
|
||||
* `optionsMirroringCategoryName`
|
||||
* `optionsMirroringCategoryDescription`
|
||||
* `optionsMirroringEnabled`
|
||||
* `optionsMirroringAppId`
|
||||
& `popupMediaTypeAppNotFound`
|
||||
* `popupMediaTypeAppNotFound`
|
||||
* `optionsBridgeCompatible`
|
||||
* `optionsBridgeLikelyCompatible`
|
||||
* `optionsBridgeIncompatible`
|
||||
|
||||
* `nl`
|
||||
* `optionsBridgeBackupEnabled`
|
||||
@@ -57,6 +63,9 @@ Missing/outdated strings:
|
||||
* `optionsMirroringEnabled`
|
||||
* `optionsMirroringAppId`
|
||||
* `popupMediaTypeAppNotFound`
|
||||
* `optionsBridgeCompatible`
|
||||
* `optionsBridgeLikelyCompatible`
|
||||
* `optionsBridgeIncompatible`
|
||||
|
||||
|
||||
### NSIS Installer Localization
|
||||
|
||||
@@ -151,15 +151,15 @@
|
||||
, "description": "Bridge stats recommended action row title."
|
||||
}
|
||||
, "optionsBridgeCompatible": {
|
||||
"message": "COMPATIBLE"
|
||||
"message": "Compatible"
|
||||
, "description": "Compatibility status is definitely compatible."
|
||||
}
|
||||
, "optionsBridgeLikelyCompatible": {
|
||||
"message": "LIKELY COMPATIBLE"
|
||||
"message": "Likely compatible"
|
||||
, "description": "Compatibility status is probably compatible."
|
||||
}
|
||||
, "optionsBridgeIncompatible": {
|
||||
"message": "INCOMPATIBLE"
|
||||
"message": "Incompatible"
|
||||
, "description": "Compatibility status is definitely incompatible."
|
||||
}
|
||||
, "optionsBridgeOlderAction": {
|
||||
|
||||
@@ -77,19 +77,24 @@ const getInfo = () => new Promise<BridgeInfo>(async (resolve, reject) => {
|
||||
|
||||
clearTimeout(bridgeTimeoutId);
|
||||
|
||||
const extensionVersion = browser.runtime.getManifest().version;
|
||||
const extensionVersionMajor = semver.major(extensionVersion);
|
||||
|
||||
const versionDiff = semver.diff(applicationVersion, extensionVersion);
|
||||
|
||||
/**
|
||||
* If the target version is above 0.x.x range, API is stable
|
||||
* and versions with minor or patch level changes should be
|
||||
* compatible.
|
||||
*/
|
||||
const isVersionCompatible =
|
||||
semver.eq(applicationVersion, APPLICATION_VERSION)
|
||||
|| semver.diff(applicationVersion, APPLICATION_VERSION) !== "major"
|
||||
&& semver.major(APPLICATION_VERSION) !== 0;
|
||||
semver.eq(applicationVersion, extensionVersion)
|
||||
|| (versionDiff !== "major" && extensionVersionMajor !== 0)
|
||||
|| (versionDiff === "patch" && extensionVersionMajor === 0);
|
||||
|
||||
const isVersionExact = semver.eq(applicationVersion, APPLICATION_VERSION);
|
||||
const isVersionOlder = semver.lt(applicationVersion, APPLICATION_VERSION);
|
||||
const isVersionNewer = semver.gt(applicationVersion, APPLICATION_VERSION);
|
||||
const isVersionExact = semver.eq(applicationVersion, extensionVersion);
|
||||
const isVersionOlder = semver.lt(applicationVersion, extensionVersion);
|
||||
const isVersionNewer = semver.gt(applicationVersion, extensionVersion);
|
||||
|
||||
// Print compatibility info to console
|
||||
if (!isVersionCompatible) {
|
||||
|
||||
@@ -44,14 +44,14 @@ const BridgeStats = (props: BridgeStatsProps) => (
|
||||
<tr>
|
||||
<th>{ _("optionsBridgeStatsRecommendedAction") }</th>
|
||||
<td>
|
||||
{ // If older
|
||||
props.info.isVersionOlder
|
||||
? _("optionsBridgeOlderAction")
|
||||
// else if newer
|
||||
: props.info.isVersionNewer
|
||||
? _("optionsBridgeNewerAction")
|
||||
// else
|
||||
: _("optionsBridgeNoAction")
|
||||
{
|
||||
props.info.isVersionCompatible
|
||||
? _("optionsBridgeNoAction")
|
||||
: props.info.isVersionOlder
|
||||
? _("optionsBridgeOlderAction")
|
||||
: props.info.isVersionNewer
|
||||
? _("optionsBridgeNewerAction")
|
||||
: _("optionsBridgeNoAction")
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user