Skip to content

Conversation

@fdietze
Copy link
Member

@fdietze fdietze commented Jun 22, 2019

  • cache empty page because of channels
  • load latest graph when coming online
  • store current graph when closing browser window
  • store current graph when switching focus (all switches need to be triggered by GlobalState.focus())
  • safe access of localstorage -> internal: Option[Storage] ?
  • invalidate cache on user-change (store all pageids in one storage key)

}
}

def getGraph(page: Page): Option[Graph] = page.parentId.flatMap(getGraph)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to cache empty pages, too. Because it contains all channels and the user node - is called when switching to welcome view.

}

def getGraph(page: Page): Option[Graph] = page.parentId.flatMap(getGraph)
def getGraph(pageId: NodeId): Option[Graph] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check canAccessLS before all this methods, so we do not crash when LocalStorage is disabled in a browser. Maybe make internal an option?

@cornerman
Copy link
Member

Generally LGTM 💟, I just added two comments.

@fdietze fdietze added the todo label Nov 19, 2019
@fdietze fdietze force-pushed the graph-cache branch 2 times, most recently from fe7489f to 8b83a7a Compare November 30, 2019 23:45
…ls.scala,Components.scala,CreateNewPrompt.scala,DoodleView.scala,MembersModal.scala,NewProjectPrompt.scala
….scala,Notifications.scala,UrlConfig.scala,BinaryConvertors.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants