Merge pull request #5262 from matrix-org/t3chguy/fix/15286

MELS use latest avatar rather than the first avatar
This commit is contained in:
Michael Telatynski 2020-10-02 18:18:36 +01:00 committed by GitHub
commit 6caf53bd1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 150 additions and 110 deletions

View file

@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {useState} from "react";
import {Dispatch, SetStateAction, useState} from "react";
// Hook to simplify toggling of a boolean state value
// Returns value, method to toggle boolean value and method to set the boolean value
export const useStateToggle = (initialValue: boolean) => {
export const useStateToggle = (initialValue: boolean): [boolean, () => void, Dispatch<SetStateAction<boolean>>] => {
const [value, setValue] = useState(initialValue);
const toggleValue = () => {
setValue(!value);