Fix/save active device only in local storage (#643)
* Save "activeDevice" in the local storage * Set default back to for "DeviceSetting"
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export const DEFAULT_DEVICE = 'default';
|
||||
|
||||
let activeDevice = DEFAULT_DEVICE;
|
||||
@@ -13,3 +15,8 @@ export const getActiveDevice = (): string => activeDevice;
|
||||
export const setActiveDevice = (device: string) => {
|
||||
activeDevice = device;
|
||||
};
|
||||
|
||||
export const ActiveDevice = React.createContext<{ activeDevice: string; setActiveDevice: (device: string) => void }>({
|
||||
activeDevice: DEFAULT_DEVICE,
|
||||
setActiveDevice: () => {},
|
||||
});
|
||||
|
||||
@@ -37,7 +37,6 @@ const GLOBAL_METADATA_KEYS: AppMetadataKeys[] = [
|
||||
|
||||
// client
|
||||
'devices',
|
||||
'activeDevice',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,6 @@ export const getDefaultSettings = (): MetadataServerSettings => ({
|
||||
|
||||
// client
|
||||
devices: [DEFAULT_DEVICE],
|
||||
activeDevice: DEFAULT_DEVICE,
|
||||
});
|
||||
|
||||
export const convertSettingsToMetadata = (
|
||||
|
||||
Reference in New Issue
Block a user