Skip to content

Remove the extension from the filename shown as title #21

@Sergih28

Description

@Sergih28

📄 Description

Remove the extension from the setup filename in processSetupsContent, as it's not relevant for the user when it comes to see the setup content.

.svm is the extension that all the setups should have, at least at the point of opening this issue, as it's the extension used by rFactor 2 setups.

📝 Additional comments

So if we were to load a setup called Silverstone_v1.svm the name that should be saved on that object would be Silverstone_v1, not Silverstone_v1.svm

🔁 Steps to Solve

  1. Create a function called removeExtension, right above processSetupsContent
  2. Receive the setup.name (call it name) as params (string), and return a string
  3. In the function we just created, check with javascript's str.endsWith if the name ends with .svm
  4. If it does end with .svm, remove that part with name.substring(0, name.length - 4).
  5. If it does not end with .svm, return the same name

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood issue to start working for the first time on this project.priority: lowLow priority, no rush.reactReact related.status: availableReady to start.type: enhancementImprovement of an existing feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions