mirror of
https://github.com/wassname/talk.git
synced 2026-10-02 12:50:49 +08:00
Implement pym storage
This commit is contained in:
1 parent
bcf24cbb4b
commit
ccf91480da
14 files changed
+374
-3
No files matched your search
@@ -22,6 +22,8 @@ export default async function initLocalState(
|
||||
environment: Environment,
|
||||
{ localStorage }: TalkContext
|
||||
) {
|
||||
const authToken = await localStorage.getItem("authToken");
|
||||
|
||||
commitLocalUpdate(environment, s => {
|
||||
// TODO: (cvle) move local, auth token and network initialization to framework.
|
||||
const root = s.getRoot();
|
||||
@@ -31,7 +33,7 @@ export default async function initLocalState(
|
||||
root.setLinkedRecord(localRecord, "local");
|
||||
|
||||
// Set auth token
|
||||
localRecord.setValue(localStorage.getItem("authToken") || "", "authToken");
|
||||
localRecord.setValue(authToken || "", "authToken");
|
||||
|
||||
// Set initial auth revision, this is increment whenenver auth state might have changed.
|
||||
localRecord.setValue(0, "authRevision");
|
||||
|
||||
Reference in new issue
Block a user