tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
2.89k stars 244 forks source link

Refactor hostname helper function #1735

Closed jdeanwallace closed 5 months ago

jdeanwallace commented 5 months ago

Related https://github.com/tiny-pilot/tinypilot-pro/issues/1162 Resolves https://github.com/tiny-pilot/tinypilot/issues/771

This PR refactors the futureLocation function to app/static/js/hostname.js and renames it to determineFutureOrigin. This change is needed to allow the function to be reused by https://github.com/tiny-pilot/tinypilot-pro/pull/1169

This is mostly a non-functional change with the following caveats:

  1. Name change
    • Before futureLocation
    • After determineFutureOrigin
  2. Docstring change
  3. Added guard on oldHostname variable
  4. Added tests

Review on CodeApprove

jdeanwallace commented 5 months ago
Automated comment from CodeApprove ➜

⏳ @jotaen4tinypilot please review this Pull Request