v1.5.2/auto leave
This commit is contained in:
+12
-2
@@ -24,6 +24,7 @@ import {
|
|||||||
PLAYER_STATUS,
|
PLAYER_STATUS,
|
||||||
getPlayerSource,
|
getPlayerSource,
|
||||||
LocalData,
|
LocalData,
|
||||||
|
LeaveRoomApi,
|
||||||
updateLocalData,
|
updateLocalData,
|
||||||
getUserUid,
|
getUserUid,
|
||||||
} from './Api';
|
} from './Api';
|
||||||
@@ -57,10 +58,19 @@ export default class Create extends Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { lastActive, userName, partyName, partyPin } = LocalData();
|
const { lastActive, userName, partyName, partyPin } = LocalData();
|
||||||
if (Math.abs(new Date(parseInt(lastActive)) - new Date().getTime()) <= 60000) {
|
if (userName && partyName && partyPin) {
|
||||||
if (userName && partyName && partyPin) {
|
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);
|
||||||
|
} else {
|
||||||
|
this.props.updateLoading(true);
|
||||||
|
const data = {
|
||||||
|
partyName: LocalData().partyName,
|
||||||
|
userUid: LocalData().userUid,
|
||||||
|
};
|
||||||
|
LeaveRoomApi(data).then((res) => {
|
||||||
|
this.props.updateLoading(false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user