Files
Fleetbase-Mirror-Repo/console/app/services/onboarding-context.js
Ronald A. Richardson 5d1b2e1939 - Made the LogApiRequests middleware more robust
- Fixed controller validation handling
- Added microsoft365/graph mail driver
- Improved password requirements (including breached password check)
- Patched creating duplicate users by email in IAM
- Patch env mapper
- Vehicle/driver tracking API doesnt fire resource lifecycle events or log requests - only tracking events
- Patched `<ModelCoordinatesInput />` component
- Security patch on Storefront customers API
- Styling updates on Storefront
2025-11-06 20:33:23 +08:00

40 lines
1.1 KiB
JavaScript

import Service, { inject as service } from '@ember/service';
import { tracked } from '@glimmer/tracking';
export default class OnboardingContextService extends Service {
@service appCache;
@tracked data = {};
get(key) {
return this.data[key] ?? this.appCache.get(`onboarding:context:${key}`);
}
getFromCache(key) {
return this.appCache.get(`onboarding:context:${key}`);
}
set(key, value, options = {}) {
this.data = { ...this.data, [key]: value };
if (options?.persist === true) {
this.appCache.set(`onboarding:context:${key}`, value);
}
}
persist(key, value) {
this.set(key, value, { persist: true });
}
del(key) {
const { [key]: _drop, ...rest } = this.data; // eslint-disable-line no-unused-vars
this.data = rest;
this.appCache.set(`onboarding:context:${key}`, undefined);
}
reset() {
for (let key in this.data) {
this.appCache.set(`onboarding:context:${key}`, undefined);
}
this.data = {};
}
}