bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/storage/index.ts
João Victor Nunes 06500be757
refactor(storage): replace Tracker.Dependency with observer hook (#20322)
* refactor(storage): replace Tracker.Dependency with observer hook

* fix(storage): set initial value

* refactor(storage): stop using Meteor's Session singleton
2024-06-06 10:50:03 -03:00

16 lines
469 B
TypeScript

import Local from './local';
import ObservableStorage from './observable';
import Session from './session';
let StorageSingleton: ObservableStorage | null = null;
export const getStorageSingletonInstance = () => {
const APP_CONFIG = window.meetingClientSettings.public.app;
if (!StorageSingleton) {
StorageSingleton = APP_CONFIG.userSettingsStorage === 'local' ? Local : Session;
}
return StorageSingleton;
};
export default getStorageSingletonInstance;