Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate cleanup from close function
`close()` delegates to `OCA.Viewer.close()`. It is just a shortcut to be used in the template. `cleanup()` does the actual work. `OCA.Viewer.close()` will set `file` to `''`. `file` is being watched and the watch function triggers the cleanup. This way each step is only getting called once. Here's what was happening before: * clicking the ❌ triggers the close function * close function calls `OCA.Viewer.close()` and triggers the callback * `OCA.Viewer.close()` sets `file` to `''` * the `file` watcher triggers the close function again * close function calls `OCA.Viewer.close()` and triggers the callback again * `OCA.Viewer.close()` sets `file` to `''` * this time it has no effect because it already was empty. Signed-off-by: Azul <azul@riseup.net>
- Loading branch information