Bump turbo-rails for Turbo.offline.clearCache()
Simplify the clear-offline-cache controller to use the new Turbo.offline.clearCache() API instead of messaging the service worker directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
import { Turbo } from "@hotwired/turbo-rails"
|
||||
|
||||
export default class extends Controller {
|
||||
async clearCache() {
|
||||
const registration = await navigator.serviceWorker?.ready
|
||||
registration?.active?.postMessage({ action: "clearCache" })
|
||||
clearCache() {
|
||||
Turbo.offline.clearCache()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user