Skip to content

Commit

Permalink
Use dynamic import for homebridge ui script
Browse files Browse the repository at this point in the history
  • Loading branch information
dgreif committed Oct 14, 2024
1 parent 9296458 commit ff1719e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/homebridge-ring/homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ <h4 id="ring-link-account-header" class="text-center primary-text mb-3" style="d
Link Ring Account
</h4>

<script>
<script type="module">
// Show the spinner while the JS is loading
homebridge.showSpinner()

// Create a script tag to load the JS onto the page
const script = document.createElement('script')

// import the JS module for the custom UI
// Use the installed version of homebridge to bust the cache for the script
script.src = `homebridge-ring-ui.js?v=${homebridge.plugin.installedVersion}`

// Append the script to the head of the page to load it
document.head.appendChild(script)
import(`./homebridge-ring-ui.js?v=${homebridge.plugin.installedVersion}`)
</script>

0 comments on commit ff1719e

Please sign in to comment.