v1.3.0-beta/voice call implemented

This commit is contained in:
2020-05-31 18:14:19 -04:00
parent aa15c4eb30
commit 5428c1e299
12 changed files with 256 additions and 97 deletions
+14 -4
View File
@@ -33,14 +33,16 @@ export const getPlayerSource = () => {
};
export const LocalData = () => {
return JSON.parse(window.localStorage.getItem('WatchParty')) || {};
return window.localStorage.getItem('WatchParty')
? JSON.parse(window.localStorage.getItem('WatchParty'))
: {};
};
export const updateLocalData = (data) => {
window.localStorage.setItem('WatchParty', JSON.stringify(Object.assign({}, LocalData(), data)));
};
export const emptyLocalData = () => window.localStorage.setItem('WatchParty', undefined);
export const emptyLocalData = () => window.localStorage.reject('WatchParty');
export const getUserUid = async () =>
new Promise((resolve, reject) => {
@@ -100,14 +102,14 @@ export const SendMessageApi = async (data) => {
export const LeaveRoomApi = async (data) => {
return fetcher({
endpoint: `leave/${data.roomId}/users/${data.uid}`,
endpoint: `leave/${data.partyName}/users/${data.userUid}`,
method: 'DELETE',
});
};
export const DeleteRoomApi = async (data) => {
return fetcher({
endpoint: `delete/${data.roomId}`,
endpoint: `delete/${data.partyName}`,
method: 'DELETE',
});
};
@@ -133,3 +135,11 @@ export const GetRefreshedVoxeetTokenApi = async (data) => {
method: 'GET',
});
};
export const UpdateVoxeetApi = async (data) => {
return fetcher({
endpoint: 'updateVoxeet',
method: 'POST',
body: JSON.stringify(data),
});
};