store currentDeviceId in localstorage
parent
d8656a78d4
commit
ab3edafc70
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@velaboratory/velconnect-svelte",
|
"name": "@velaboratory/velconnect-svelte",
|
||||||
"version": "1.0.4",
|
"version": "1.0.5",
|
||||||
"description": "Use VEL-Connect with a Svelte dashboard",
|
"description": "Use VEL-Connect with a Svelte dashboard",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ pb.authStore.onChange((auth) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
export const pairedDevices = writable<string[]>([]);
|
export const pairedDevices = writable<string[]>([]);
|
||||||
export const currentDeviceId = writable("");
|
const storedCurrentDeviceId = localStorage.getItem('currentDeviceId');
|
||||||
|
export const currentDeviceId = writable(storedCurrentDeviceId || "");
|
||||||
|
currentDeviceId.subscribe((value) => localStorage.setItem('currentDeviceId', value));
|
||||||
|
|
||||||
export interface Device extends Record {
|
export interface Device extends Record {
|
||||||
os_info: string;
|
os_info: string;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue