kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 194 forks source link

SSR - FlowRouter.wait not working on iOS or Safari #536

Closed PEM-- closed 8 years ago

PEM-- commented 8 years ago

I use FlowRouter.wait(); at the early beginning of my app to block routing on the client. When the router is blocked, I wait for the subscriptions to settle and create routes dynamically using some collections. When every routes are created, I release the router with a FlowRouter.initialize(); for creating routes.

This pattern works fine on Chrome (OSX & Android), Firefox. It fails on Safari (OSX & iOS).

The 'not-found' route is started despite its declaration has been postponed long after the init.

PEM-- commented 8 years ago

While investigating, onpopstate is triggered before the router is initialized on Safari (OSX & iOS).

EDIT: As the router isn't initialized yet, self.go shouldn't be called despite its idempotency as it doesn't exist yet.

PEM-- commented 8 years ago

Fixed with #538

arunoda commented 8 years ago

Thanks. Merged & Published as v3.11.1.

PEM-- commented 8 years ago

Thanks :+1: