diff --git a/app/src/Api.js b/app/src/Api.js index 30695d7..f7894f3 100644 --- a/app/src/Api.js +++ b/app/src/Api.js @@ -61,7 +61,15 @@ export const updateLocalData = (data) => { window.localStorage.setItem('WatchParty', JSON.stringify(Object.assign({}, LocalData(), data))); }; -export const emptyLocalData = () => window.localStorage.removeItem('WatchParty'); +export const removeLocalData = (key) => { + var data = LocalData(); + delete data[key]; + window.localStorage.setItem('WatchParty', JSON.stringify(data)); +}; + +export const emptyLocalData = () => { + window.localStorage.removeItem('WatchParty'); +}; export const getUserUid = async () => new Promise((resolve, reject) => { diff --git a/app/src/Create.js b/app/src/Create.js index 13ecd3a..34f16c3 100644 --- a/app/src/Create.js +++ b/app/src/Create.js @@ -58,7 +58,7 @@ export default class Create extends Component { } componentDidMount() { const { lastActive, userName, partyName, partyPin } = LocalData(); - if (userName && partyName && partyPin) { + if (lastActive && userName && partyName && partyPin) { if (Math.abs(new Date(parseInt(lastActive)) - new Date().getTime()) <= 60000) { this.props.updateLoading(true); this.joinCall(userName, partyName, partyPin);