1
0
mirror of https://github.com/hyperspacedev/hyperspace synced 2025-01-31 01:29:37 +01:00

HD-21 Return undefined in EmojiPicker's retrieveFromLocal if the localStorage item is null

This commit is contained in:
Marquis Kurt 2019-11-19 17:46:03 -05:00
parent 2ad8c8fb45
commit e6ab97be66
No known key found for this signature in database
GPG Key ID: 725636D259F5402D
2 changed files with 7 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "hyperspace", "name": "hyperspace",
"version": "1.0.3", "version": "1.0.4",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -8,7 +8,12 @@ interface IEmojiPickerProps extends PickerProps {
export class EmojiPicker extends Component<IEmojiPickerProps, any> { export class EmojiPicker extends Component<IEmojiPickerProps, any> {
retrieveFromLocal() { retrieveFromLocal() {
return JSON.parse(localStorage.getItem("emojis") as string); let emojiStorage = localStorage.getItem("emojis");
if (emojiStorage != null) {
return JSON.parse(emojiStorage as string);
} else {
return undefined;
}
} }
render() { render() {