v1.5.2/api update to handle remove localstorage key
This commit is contained in:
+9
-1
@@ -61,7 +61,15 @@ export const updateLocalData = (data) => {
|
|||||||
window.localStorage.setItem('WatchParty', JSON.stringify(Object.assign({}, LocalData(), 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 () =>
|
export const getUserUid = async () =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ export default class Create extends Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { lastActive, userName, partyName, partyPin } = LocalData();
|
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) {
|
if (Math.abs(new Date(parseInt(lastActive)) - new Date().getTime()) <= 60000) {
|
||||||
this.props.updateLoading(true);
|
this.props.updateLoading(true);
|
||||||
this.joinCall(userName, partyName, partyPin);
|
this.joinCall(userName, partyName, partyPin);
|
||||||
|
|||||||
Reference in New Issue
Block a user