Commit b071c2ad authored by Randall Leeds's avatar Randall Leeds

Confirm draft discard on any tool change

Prevents losing track of drafts when switching from highlighter to
comment tool if replies have been started in the sidebar.
parent 271df572
......@@ -449,13 +449,12 @@ class Hypothesis extends Annotator
setTool: (name) =>
return if name is @tool
return unless this.discardDrafts()
scope = @element.scope()
if name is 'highlight'
return unless this.discardDrafts()
# Check login state first
unless @plugins.Auth? and @plugins.Auth.haveValidToken()
scope = @element.scope()
# If we are not logged in, start the auth process
scope.ongoingHighlightSwitch = true
# No need to reload annotations upon login, since Social View change
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment