Skip to content

Commit

Permalink
Merge pull request #3 from Spencer17x/main
Browse files Browse the repository at this point in the history
feat: 1.0.2-beta
  • Loading branch information
spencer17x authored Aug 18, 2021
2 parents 0c13379 + d3c8e67 commit 2f2fa61
Show file tree
Hide file tree
Showing 6 changed files with 1,339 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qnweb-im-demo",
"version": "1.0.0-beta",
"version": "1.0.1-beta",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand Down
13 changes: 8 additions & 5 deletions src/hooks/useChatroom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ const useChatroom = (roomTokenJSON?: RoomTokenJSON | null) => {
group_id: roomTokenJSON.roomName
}).then(response => {
setGroupId(response.data.im_group_id);
return response.data.im_group_id
return response.data.im_group_id;
}).then(groupId => {
im.chatroomManage.join(groupId)
im.chatroomManage.join(groupId);
});
}
}, [roomTokenJSON, state.im]);

useEffect(() => {
return () => {
if (roomTokenJSON && im) {
// im.chatroomManage.leave(6683356385697);
if (groupId && state.im) {
state.im.chatroomManage.leave(groupId);
}
};
}, [roomTokenJSON, state.im]);
}, [state.im, groupId]);

return {
group_id: groupId
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/qnweb-im.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
Expand Down
2 changes: 0 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import reactRefresh from '@vitejs/plugin-react-refresh';

const packageJson = require('./package.json');

console.log('当前环境', process.env.NODE_ENV);

// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()],
Expand Down
Loading

0 comments on commit 2f2fa61

Please sign in to comment.