mirror of
https://github.com/fleetbase/fleetbase.git
synced 2026-02-24 18:07:06 +00:00
- Persist navigation history to localStorage on each step
- Restore history when resuming from previous session
- Clear history when flow completes
- Fixes back button functionality after page refresh
- Uses flow-specific storage key pattern: onboarding:history:{flowId}
23 lines
600 B
JavaScript
23 lines
600 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class OnboardIndexRoute extends Route {
|
|
@service store;
|
|
@service('onboarding-orchestrator') orchestrator;
|
|
|
|
queryParams = {
|
|
step: { refreshModel: false },
|
|
session: { refreshModel: false },
|
|
code: { refreshModel: false },
|
|
};
|
|
|
|
beforeModel() {
|
|
// Resume from previous session if data exists in localStorage
|
|
this.orchestrator.start(null, { resume: true });
|
|
}
|
|
|
|
model() {
|
|
return this.store.findRecord('brand', 1);
|
|
}
|
|
}
|