@smart-link/rn-im 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChatGroupState, CollectionState, ConversationState, ForwardState, IUser, MessageState, SettingState } from '@smart-link/im-base';
|
|
2
2
|
import { ContactState, PanelState, VideoState } from '../slice';
|
|
3
3
|
export declare function useConversation(): ConversationState;
|
|
4
|
+
export declare function useUnreadTotal(): number;
|
|
4
5
|
export declare function useAvatars(): Record<string, string>;
|
|
5
6
|
export declare function useMessage(): MessageState;
|
|
6
7
|
export declare function useAuth(): {
|
|
@@ -2,6 +2,9 @@ import { useSelector } from 'react-redux';
|
|
|
2
2
|
export function useConversation() {
|
|
3
3
|
return useSelector(state => state['chat/conversation']);
|
|
4
4
|
}
|
|
5
|
+
export function useUnreadTotal() {
|
|
6
|
+
return useSelector(state => state['chat/conversation']['unreadTotal']);
|
|
7
|
+
}
|
|
5
8
|
export function useAvatars() {
|
|
6
9
|
return useSelector(state => state['chat/conversation']['avatarsMap']);
|
|
7
10
|
}
|
package/dist/utils/upload.js
CHANGED
|
@@ -16,8 +16,8 @@ const uploadFile = (filePath, type, onProgress) => __awaiter(void 0, void 0, voi
|
|
|
16
16
|
const local = yield fetch(toAbsolutePath(filePath));
|
|
17
17
|
const file = yield local.blob();
|
|
18
18
|
const fileName = filePath.split('/').pop();
|
|
19
|
-
//
|
|
20
|
-
if (file.size > CHUNK_SIZE) {
|
|
19
|
+
// 大文件20M以上, chunk上传
|
|
20
|
+
if (file.size > CHUNK_SIZE * 10) {
|
|
21
21
|
return uploadBigFile(toFullPath(filePath), fileName, onProgress);
|
|
22
22
|
}
|
|
23
23
|
const formData = new FormData();
|
|
@@ -45,7 +45,7 @@ const uploadBigFile = (filePath, fileName, onProgress) => __awaiter(void 0, void
|
|
|
45
45
|
'Cookie': cookie,
|
|
46
46
|
},
|
|
47
47
|
onProgress: (o) => {
|
|
48
|
-
console.log('uploadBigFile: ', o)
|
|
48
|
+
// console.log('uploadBigFile: ', o)
|
|
49
49
|
onProgress && onProgress({
|
|
50
50
|
loaded: o.loaded,
|
|
51
51
|
total: o.total,
|
|
@@ -54,6 +54,7 @@ const uploadBigFile = (filePath, fileName, onProgress) => __awaiter(void 0, void
|
|
|
54
54
|
});
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
|
+
console.log('uploadBigFile: ', resp);
|
|
57
58
|
return resp.data;
|
|
58
59
|
});
|
|
59
60
|
export default uploadFile;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smart-link/rn-im",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"react-redux": "^8.1.3",
|
|
66
66
|
"redux": "^4.2.1",
|
|
67
67
|
"redux-thunk": "^2.4.2",
|
|
68
|
-
"@smart-link/rn-ui": "^1.1.
|
|
68
|
+
"@smart-link/rn-ui": "^1.1.3",
|
|
69
69
|
"@smart-link/im-base": "^1.1.2"
|
|
70
70
|
},
|
|
71
71
|
"files": [
|