Skip to content

Commit

Permalink
fix(main): Don't parse if exactly level is found in const
Browse files Browse the repository at this point in the history
  • Loading branch information
Holfz committed May 15, 2022
1 parent b578eb9 commit b36dcf6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@ SteamClient.on('user', function(sID, user) {
let parsedLevel = [];

if (level && level.value) {
// By split the level value by "_" and looking for any known termination value.
for (const e of level.value.split('_')) {
if (Termination.indexOf(e) !== -1) {
break;
// If found the exactly level in Translation. Don't parse (It's maybe a reused or event maps)
if (Translation[level.value]) {
parsedLevel = level.value;
} else {
// If not found. Try parsing.
// split the level value by "_" and looking for any known termination value.
for (const e of level.value.split('_')) {
if (Termination.indexOf(e) !== -1) {
break;
}

parsedLevel.push(e);
}

parsedLevel.push(e);
}

// And then re-join together.
Expand Down

0 comments on commit b36dcf6

Please sign in to comment.