diff --git a/src/components/common/PinButton.js b/src/components/common/PinButton.js index d2be8d929..f2b27c844 100644 --- a/src/components/common/PinButton.js +++ b/src/components/common/PinButton.js @@ -16,39 +16,26 @@ const PinButton = ({ item }) => { const [isPinned, setPinned] = useState(item?.settings?.isPinned); const handlePin = () => { - const { settings } = item; - settings.isPinned = true; + const newState = !isPinned; - editItem.mutate({ - id: item.id, - // use item login tag id - name: item.name, - settings: item.settings, - }); - - setPinned(true); - }; + setPinned(newState); - const handleUnpin = () => { const { settings } = item; - settings.isPinned = false; + settings.isPinned = newState; editItem.mutate({ id: item.id, - // use item login tag id name: item.name, settings: item.settings, }); - - setPinned(false); }; return ( {isPinned ? ( diff --git a/src/components/item/settings/ItemSettings.js b/src/components/item/settings/ItemSettings.js index 61e7b2148..fa1fe7188 100644 --- a/src/components/item/settings/ItemSettings.js +++ b/src/components/item/settings/ItemSettings.js @@ -65,7 +65,7 @@ const ItemSettings = ({ item }) => { { )} /> { ]} /> diff --git a/src/langs/en.json b/src/langs/en.json index cd19d2c3b..de87a1f8b 100644 --- a/src/langs/en.json +++ b/src/langs/en.json @@ -128,6 +128,9 @@ "Authenticated Members": "Authenticated Members", "Username and Password": "Username and Password", "Username": "Username", - "No user has authenticated to this item yet.": "No user has authenticated to this item yet." + "No user has authenticated to this item yet.": "No user has authenticated to this item yet.", + "Pin": "Pin this item", + "Unpin": "Unpin this item", + "Show Chat": "Show Chat" } } diff --git a/src/langs/fr.json b/src/langs/fr.json index a187b6638..5c76a4730 100644 --- a/src/langs/fr.json +++ b/src/langs/fr.json @@ -128,6 +128,9 @@ "Authenticated Members": "Membres Connectés", "Username and Password": "Nom d'utilisateur et Mot de passe", "Username": "Nom d'utilisateur", - "No user has authenticated to this item yet.": "Aucun utilisateur ne s'est encore connecté à cet élément." + "No user has authenticated to this item yet.": "Aucun utilisateur ne s'est encore connecté à cet élément.", + "Pin": "Epingler cet élément", + "Unpin": "Détacher cet élément", + "Show Chat": "Afficher le chat" } }