lib/isomorfeus/preact/config.rb in isomorfeus-preact-10.5.5 vs lib/isomorfeus/preact/config.rb in isomorfeus-preact-10.5.6
- old
+ new
@@ -85,25 +85,14 @@
Isomorfeus.zeitwerk.setup
Isomorfeus::TopLevel.mount!
end
def force_render
- begin
- if Isomorfeus.top_component
- Preact.find_dom_node(Isomorfeus.top_component) if on_browser? || on_desktop? # if not mounted will raise
- if `typeof Opal.global.deepForceUpdate === 'undefined'`
- Isomorfeus.top_component.JS.forceUpdate()
- else
- `Opal.global.deepForceUpdate(#{Isomorfeus.top_component})`
- end
- end
- rescue Exception => e
- # TODO try mount first
- # if it fails
- `console.error("force_render failed'! Error: " + #{e.message} + "! Reloading page.")`
- `location.reload()` if on_browser?
- end
+ `Opal.Preact.deep_force_update(#{Isomorfeus.top_component})`
nil
+ rescue Exception => e
+ `console.error("force_render failed'! Error: " + #{e.message} + "! Reloading page.")`
+ `location.reload()` if on_browser?
end
end
self.add_client_option(:client_init_class_names, [])
self.add_client_option(:client_init_after_store_class_names, [])