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:
parent
2ad8c8fb45
commit
e6ab97be66
2
package-lock.json
generated
2
package-lock.json
generated
@ -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": {
|
||||||
|
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user