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