Skip to content

Commit

Permalink
Fix decimal rounding. Improve blockly FFI structure
Browse files Browse the repository at this point in the history
  • Loading branch information
paluh committed May 29, 2023
1 parent 1cfee07 commit 99f9c50
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 172 deletions.
42 changes: 42 additions & 0 deletions changelog.d/20230529_110109_tomasz.rybarczyk_PLT_5468.md
@@ -0,0 +1,42 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed
- A bullet item for the Removed category.
-->
<!--
### Added
- A bullet item for the Added category.
-->
<!--
### Changed
- A bullet item for the Changed category.
-->
<!--
### Deprecated
- A bullet item for the Deprecated category.
-->
### Fixed

- currency/decimal fields behavior

- FFI structure of blockly related modules

<!--
### Security
- A bullet item for the Security category.
-->
4 changes: 3 additions & 1 deletion marlowe-playground-client/src/Blockly/DateTimeField.js
Expand Up @@ -210,7 +210,9 @@ export const registerDateTimeFieldImpl = (function () {
}
};

Blockly.fieldRegistry.register("field_datetime", FieldDateTime);
try {
Blockly.fieldRegistry.register("field_datetime", FieldDateTime);
} catch {}

return FieldDateTime;
};
Expand Down
8 changes: 4 additions & 4 deletions marlowe-playground-client/src/Blockly/DateTimeField.purs
@@ -1,13 +1,13 @@
module Blockly.DateTimeField where

import Prelude

import Blockly.Types (Blockly)
import Effect (Effect)
import Effect.Uncurried (EffectFn1, runEffectFn1)

foreign import registerDateTimeFieldImpl :: EffectFn1 Blockly Unit
foreign import data FieldDateTime :: Type

foreign import registerDateTimeFieldImpl :: EffectFn1 Blockly FieldDateTime

registerDateTimeField :: Blockly -> Effect Unit
registerDateTimeField :: Blockly -> Effect FieldDateTime
registerDateTimeField = runEffectFn1 registerDateTimeFieldImpl

0 comments on commit 99f9c50

Please sign in to comment.