From 4a1c69212a8c8e5b89815ebf8e6a4d180463c20a Mon Sep 17 00:00:00 2001 From: Julien Torrent Date: Wed, 8 Dec 2021 15:17:32 +0100 Subject: [PATCH] feat: enable apps to change their settings --- src/components/item/ItemContent.js | 5 ++++- yarn.lock | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/item/ItemContent.js b/src/components/item/ItemContent.js index 12b4b2b45..3c5290b64 100644 --- a/src/components/item/ItemContent.js +++ b/src/components/item/ItemContent.js @@ -37,7 +37,9 @@ const ItemContent = ({ item, enableEdition }) => { const classes = useStyles(); const itemId = item.get(ITEM_KEYS.ID); const itemType = item?.get(ITEM_KEYS.TYPE); - const { mutate: editItem } = useMutation(MUTATION_KEYS.EDIT_ITEM); + const { mutate: editItem, mutateAsync: editItemAsync } = useMutation( + MUTATION_KEYS.EDIT_ITEM, + ); const { editingItemId, setEditingItemId } = useContext(LayoutContext); // provide user to app @@ -133,6 +135,7 @@ const ItemContent = ({ item, enableEdition }) => { editCaption={isEditing} onSaveCaption={onSaveCaption} saveButtonId={saveButtonId} + onSettingsUpdate={editItemAsync} user={user} height={ITEM_DEFAULT_HEIGHT} mode={enableEdition ? APP_MODES.TEACHER : APP_MODES.STUDENT} diff --git a/yarn.lock b/yarn.lock index fe36b1404..64148de4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7735,9 +7735,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.3.564, electron-to-chromium@npm:^1.4.17": - version: 1.4.43 - resolution: "electron-to-chromium@npm:1.4.43" - checksum: c096a42ec6af0c22736f7151d1386e6597b125ad9a6379a747e67d33d03b3b2923336dbe17edad0037299e7aa1daa0f3feb726d797375e652b6918c1a467b39a + version: 1.4.45 + resolution: "electron-to-chromium@npm:1.4.45" + checksum: 8afc465bfe4873701c748626bcd3081976526b3cd9cf4b098b0a1ad90bd2be5f4933ddf1e061cc140d2793146f0901f2b96996aaecd726d0abdebcaf5d3bdbaa languageName: node linkType: hard @@ -16563,12 +16563,12 @@ __metadata: linkType: hard "regexp.prototype.flags@npm:^1.2.0, regexp.prototype.flags@npm:^1.3.1": - version: 1.3.1 - resolution: "regexp.prototype.flags@npm:1.3.1" + version: 1.4.1 + resolution: "regexp.prototype.flags@npm:1.4.1" dependencies: call-bind: ^1.0.2 define-properties: ^1.1.3 - checksum: 343595db5a6bbbb3bfbda881f9c74832cfa9fc0039e64a43843f6bb9158b78b921055266510800ed69d4997638890b17a46d55fd9f32961f53ae56ac3ec4dd05 + checksum: 77944a3ea5ae84f391fa80bff9babfedc47eadc9dc38e282b5fd746368fb787deec89c68ce3114195bf6b5782b160280a278b62d41ccc6e125afab1a7f816de8 languageName: node linkType: hard