gwchq-textjam 0.2.7 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.js +12 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -371999,11 +371999,15 @@ const Text_1 = __webpack_require__(82803);
371999
371999
  const LeaveFlowSlice_1 = __webpack_require__(52990);
372000
372000
  const SpinnerDotted_1 = __webpack_require__(79458);
372001
372001
  const styles_module_scss_1 = __importDefault(__webpack_require__(79730));
372002
+ const useProjectCache_1 = __webpack_require__(69557);
372003
+ const projectTabSync_1 = __webpack_require__(48235);
372002
372004
  const SaveBeforeLeaveModal = () => {
372003
372005
  const dispatch = (0, react_redux_1.useDispatch)();
372004
372006
  const isSaving = (0, stores_1.useAppSelector)((state) => state.editor.saving === types_1.SavingState.PROCESS);
372005
372007
  const leaveFlowStatus = (0, stores_1.useAppSelector)((state) => state.leaveFlow?.status);
372006
372008
  const leaveFlowId = (0, stores_1.useAppSelector)((state) => state.leaveFlow?.requestId);
372009
+ const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
372010
+ const { upsertCacheValue } = (0, useProjectCache_1.useProjectCache)();
372007
372011
  const isModalOpen = [
372008
372012
  LeaveFlowSlice_1.LeaveFlowStatus.CONFIRMING,
372009
372013
  LeaveFlowSlice_1.LeaveFlowStatus.SAVING,
@@ -372011,7 +372015,14 @@ const SaveBeforeLeaveModal = () => {
372011
372015
  const handleClose = () => {
372012
372016
  dispatch((0, LeaveFlowSlice_1.leaveCancelled)({ requestId: leaveFlowId }));
372013
372017
  };
372014
- const handleLeaveConfirmed = () => {
372018
+ const handleLeaveConfirmed = async () => {
372019
+ if (project?.identifier) {
372020
+ upsertCacheValue(project.identifier, project)
372021
+ .then(() => {
372022
+ (0, projectTabSync_1.notifyProjectUpdated)(project.identifier);
372023
+ })
372024
+ .catch(console.error);
372025
+ }
372015
372026
  dispatch((0, LeaveFlowSlice_1.leaveConfirmed)({ requestId: leaveFlowId }));
372016
372027
  };
372017
372028
  const handleSaveConfirmed = () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gwchq-textjam",
3
3
  "description": "Embeddable React editor used in Raspberry Pi text-based projects.",
4
- "version": "0.2.7",
4
+ "version": "0.2.8",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/GirlsFirst/gwchq-textjam",
7
7
  "author": "Girls Who Code HQ",