View Single Post
07-31-19, 08:04 PM   #12
wildcard25
An Aku'mai Servant
 
wildcard25's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 30
Well my guess was right, and while I don't particularly like js, I can use it if I have to. From their code
Code:
t.getInstalledVersion = function() {
    return t.props.instance.installedData.installedFile.fileName
}
it should be
Code:
    return t.props.instance.installedData.installedFile.displayName
And their Game Version code filters an unordered list by release type, then just takes the Game Version from the last entry of the unordered list. So, basically, it could be any version of the game that has a release of the same type.
Code:
t.getGameVersion = function() {
    var e = t.props.instance.addon.gameVersionLatestFiles && t.props.instance.addon.gameVersionLatestFiles.filter(function(e) {
        return 1 === e.fileType
    }) || [];
    return e.length ? e[e.length - 1].gameVersion : Object(m.d)("N/A", "InstalledAddon")
}
On the plus side, they corrected the spelling mistake and it's now called "gameVersion" instead of "GameVesion"

edit: Funny thing is, where they get the fileName attribute (again they should be using displayName) for the latest addon version, the game version is also there as an attribute.

Last edited by wildcard25 : 08-01-19 at 06:44 AM.
  Reply With Quote