mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Change update local store to instead store in the matrixSessions array for multiple sessions
This commit is contained in:
parent
0ce857f499
commit
b1793832a3
1 changed files with 11 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import cons from '../state/cons';
|
import { setLocalStorageItem } from '../../app/state/utils/atomWithLocalStorage';
|
||||||
|
import { Session } from '../../app/state/sessions';
|
||||||
|
|
||||||
export function updateLocalStore(
|
export function updateLocalStore(
|
||||||
accessToken: string,
|
accessToken: string,
|
||||||
|
|
@ -6,8 +7,13 @@ export function updateLocalStore(
|
||||||
userId: string,
|
userId: string,
|
||||||
baseUrl: string
|
baseUrl: string
|
||||||
) {
|
) {
|
||||||
localStorage.setItem(cons.secretKey.ACCESS_TOKEN, accessToken);
|
const newSession: Session = {
|
||||||
localStorage.setItem(cons.secretKey.DEVICE_ID, deviceId);
|
accessToken,
|
||||||
localStorage.setItem(cons.secretKey.USER_ID, userId);
|
deviceId,
|
||||||
localStorage.setItem(cons.secretKey.BASE_URL, baseUrl);
|
userId,
|
||||||
|
baseUrl,
|
||||||
|
fallbackSdkStores: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
setLocalStorageItem('matrixSessions', [newSession]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue