mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #68 from sharelatex/bg-fix-settings-save-for-root-doc-id
handle null values when saving rootDoc_id
This commit is contained in:
commit
fbaea831c2
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ define [
|
|||
|
||||
$scope.$watch "project.rootDoc_id", (rootDoc_id, oldRootDoc_id) =>
|
||||
return if @ignoreUpdates
|
||||
if oldRootDoc_id? and rootDoc_id != oldRootDoc_id
|
||||
# don't save on initialisation, Angular passes oldRootDoc_id as
|
||||
# undefined in this case.
|
||||
return if typeof oldRootDoc_id is "undefined"
|
||||
# otherwise only save changes, null values are allowed
|
||||
if (rootDoc_id != oldRootDoc_id)
|
||||
settings.saveProjectSettings({rootDocId: rootDoc_id})
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue