mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 14:18:57 +00:00
- 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
40 lines
1.1 KiB
JavaScript
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 = {};
|
|
}
|
|
}
|