@jetthai/cuora 1.1.38 → 1.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/dist/bundle.mjs +5 -2
- package/package.json +1 -1
- package/src/machine/setting.js +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.39](https://github.com/jetthai/cuora-module/compare/v1.1.38...v1.1.39) (2023-01-16)
|
|
6
|
+
|
|
5
7
|
### [1.1.38](https://github.com/jetthai/cuora-module/compare/v1.1.37...v1.1.38) (2023-01-13)
|
|
6
8
|
|
|
7
9
|
### [1.1.37](https://github.com/jetthai/cuora-module/compare/v1.1.36...v1.1.37) (2023-01-13)
|
package/dist/bundle.mjs
CHANGED
|
@@ -13209,6 +13209,8 @@ function setting () {
|
|
|
13209
13209
|
id: 'setting',
|
|
13210
13210
|
initial: 'idle',
|
|
13211
13211
|
context: {
|
|
13212
|
+
musicPlay: true,
|
|
13213
|
+
soundPlay: true,
|
|
13212
13214
|
sound: false,
|
|
13213
13215
|
music: false,
|
|
13214
13216
|
locale: 'en-US',
|
|
@@ -13225,8 +13227,9 @@ function setting () {
|
|
|
13225
13227
|
},
|
|
13226
13228
|
{
|
|
13227
13229
|
actions: {
|
|
13228
|
-
fetchSetting: assign(() => {
|
|
13229
|
-
const
|
|
13230
|
+
fetchSetting: assign((context, event) => {
|
|
13231
|
+
const { musicPlay, soundPlay } = context;
|
|
13232
|
+
const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay };
|
|
13230
13233
|
return { ...setting }
|
|
13231
13234
|
}),
|
|
13232
13235
|
saveSetting: assign((context, event) => {
|
package/package.json
CHANGED
package/src/machine/setting.js
CHANGED
|
@@ -6,6 +6,8 @@ export default function () {
|
|
|
6
6
|
id: 'setting',
|
|
7
7
|
initial: 'idle',
|
|
8
8
|
context: {
|
|
9
|
+
musicPlay: true,
|
|
10
|
+
soundPlay: true,
|
|
9
11
|
sound: false,
|
|
10
12
|
music: false,
|
|
11
13
|
locale: 'en-US',
|
|
@@ -22,8 +24,9 @@ export default function () {
|
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
actions: {
|
|
25
|
-
fetchSetting: assign(() => {
|
|
26
|
-
const
|
|
27
|
+
fetchSetting: assign((context, event) => {
|
|
28
|
+
const { musicPlay, soundPlay } = context
|
|
29
|
+
const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay }
|
|
27
30
|
return { ...setting }
|
|
28
31
|
}),
|
|
29
32
|
saveSetting: assign((context, event) => {
|