Skip to content

Commit 0ee2f0c

Browse files
committed
fix major version regex
1 parent 29cedf7 commit 0ee2f0c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

photon-client/src/components/settings/DeviceCard.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const openOfflineUpdatePrompt = () => {
3232
};
3333
3434
const offlineUpdateRegex = new RegExp("photonvision-((?:dev-)?v[\\w.-]+)-((?:linux|win|mac)\\w+)\\.jar");
35-
const majorVersionRegex = new RegExp("/(?:dev-)?(\d+)\.\d+\.\d+/");
35+
const majorVersionRegex = new RegExp("(?:dev-)?(\\d+)\\.\\d+\\.\\d+");
3636
3737
const offlineUpdateDialog = ref({ show: false, version: "", confirmString: "" });
3838
@@ -55,9 +55,10 @@ const handleOfflineUpdateRequest = async () => {
5555
const currentVersion = useSettingsStore().general.imageVersion;
5656
const currentArch = useSettingsStore().general.wpilibArch;
5757
58-
const versionMatch = currentVersion
59-
? version.match(majorVersionRegex)?.[1] === currentVersion.match(majorVersionRegex)?.[1]
60-
: false;
58+
const versionMajor = version.match(majorVersionRegex)?.[1];
59+
const currentVersionMajor = currentVersion?.match(majorVersionRegex)?.[1];
60+
61+
const versionMatch = currentVersion ? versionMajor === currentVersionMajor : false;
6162
const dev = version.includes("dev");
6263
6364
const confirmStrings = [

0 commit comments

Comments
 (0)