2016-07-07 20:50:07 +08:00
|
|
|
import Local from './local';
|
2024-06-06 21:50:03 +08:00
|
|
|
import ObservableStorage from './observable';
|
2016-07-07 20:50:07 +08:00
|
|
|
import Session from './session';
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2024-06-06 21:50:03 +08:00
|
|
|
let StorageSingleton: ObservableStorage | null = null;
|
2024-05-29 21:26:11 +08:00
|
|
|
export const getStorageSingletonInstance = () => {
|
|
|
|
const APP_CONFIG = window.meetingClientSettings.public.app;
|
2022-11-04 04:57:54 +08:00
|
|
|
|
2024-05-29 21:26:11 +08:00
|
|
|
if (!StorageSingleton) {
|
|
|
|
StorageSingleton = APP_CONFIG.userSettingsStorage === 'local' ? Local : Session;
|
|
|
|
}
|
|
|
|
return StorageSingleton;
|
|
|
|
};
|
2022-11-04 04:57:54 +08:00
|
|
|
|
2024-05-29 21:26:11 +08:00
|
|
|
export default getStorageSingletonInstance;
|