@capytale/meta-player 0.5.7 → 0.5.8
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/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -52,10 +52,10 @@ const App: FC<AppProps> = (props) => {
|
|
|
52
52
|
(e: KeyboardEvent<HTMLDivElement>) => {
|
|
53
53
|
if ((e.ctrlKey || e.metaKey) && e.key === "s") {
|
|
54
54
|
e.preventDefault();
|
|
55
|
-
if (hasSaveButton) save(); // Checks if can save inside of save()
|
|
55
|
+
if (hasSaveButton && isDirty) save(); // Checks if can save inside of save()
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
[isDirty, save],
|
|
58
|
+
[hasSaveButton, isDirty, save],
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
const pedagoOpenLabel = hasPedago
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
2
|
import { useAppDispatch, useAppSelector } from "../../app/hooks";
|
|
3
|
-
import { selectHasEvaluations,
|
|
3
|
+
import { selectHasEvaluations, selectMode, selectPreventEditIfHasEvaluations, setIsPlayerDirty, setSaveState } from "./activityDataSlice";
|
|
4
4
|
|
|
5
5
|
export const useNotifyIsDirty = () => {
|
|
6
6
|
const dispatch = useAppDispatch();
|
|
@@ -8,7 +8,6 @@ export const useNotifyIsDirty = () => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export const useCanSave = () => {
|
|
11
|
-
const isDirty = useAppSelector(selectIsDirty);
|
|
12
11
|
const preventEditIfHasEvaluations = useAppSelector(
|
|
13
12
|
selectPreventEditIfHasEvaluations,
|
|
14
13
|
);
|
|
@@ -20,10 +19,6 @@ export const useCanSave = () => {
|
|
|
20
19
|
return false;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
if (!isDirty) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
return true;
|
|
28
23
|
}
|
|
29
24
|
|
|
Binary file
|