[+] Create function to check version number

This commit is contained in:
Hykilpikonna
2019-10-20 18:53:03 -04:00
parent be2dcbf085
commit cb54ae4dee
+18
View File
@@ -38,6 +38,24 @@ export default class Login extends Vue
}
}
/**
* Check version number
*
* @returns boolean Need to clear cookies or not
*/
public needToUpdateCookies(): boolean
{
// Version doesn't exist
if (!this.$cookies.isKey('va.version')) return true;
// Get version numbers
let currentVersion = Constants.VERSION.split('.');
let cookiesVersion = this.$cookies.get('va.version').split('.');
// Check the commit number is even or odd
return +currentVersion[currentVersion.length - 1] % 2 != +cookiesVersion[cookiesVersion.length - 1] % 2;
}
/**
* On click, sends username and password to the server.
*/