Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: undo block deletion needs multiple steps #8833

Merged
merged 10 commits into from Mar 21, 2023
Merged

Conversation

tiensonqin
Copy link
Contributor

@tiensonqin tiensonqin commented Mar 16, 2023

@tiensonqin tiensonqin marked this pull request as ready for review March 16, 2023 08:31
:end? true}})
new-content (str value "" (:block/content next-block))
repo (state/get-current-repo)]
(outliner-tx/transact! transact-opts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can group multiple operations in the same db transaction with outliner-tx/transact!.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

transact! could be nested too.

@@ -18,7 +18,7 @@
(move-blocks! ...)
(delete-blocks! ...))"
[opts & body]
(assert (map? opts))
(assert (or (map? opts) (symbol? opts)) (str "opts is not a map or symbol, type: " (type opts) ))
Copy link
Contributor

Choose a reason for hiding this comment

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

better to have a schema for opts? and validate using :malli/schema? (not sure :malli/schema is supported on defmacro)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated b9a0f40

Copy link
Collaborator

@xyhp915 xyhp915 left a comment

Choose a reason for hiding this comment

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

Works great! Both in MacOS and Windows.

@tiensonqin tiensonqin merged commit 0eab5eb into master Mar 21, 2023
5 checks passed
@tiensonqin tiensonqin deleted the fix/undo-delete-block branch March 21, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants