mirror of
https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
synced 2025-06-01 14:32:51 +00:00
Merge branch 'main' of https://github.com/TangSengDaoDao/TangSengDaoDaoWeb
This commit is contained in:
commit
9de9346720
@ -7,7 +7,7 @@
|
||||
"scripts": {
|
||||
"start": "cross-env BROWSER=none REACT_APP_VERSION=$npm_package_version react-app-rewired start",
|
||||
"dev": "cross-env MODE=dev BROWSER=none REACT_APP_VERSION=$npm_package_version react-app-rewired start",
|
||||
"dev-ele": "kill-port 3000 && concurrently -k -n=web,ele -c=green,blue \"wait-on tcp:3000 && yarn dev\" \"npm-run-all watch\"",
|
||||
"dev-ele": "concurrently -k -n=web,ele -c=green,blue \"yarn dev\" \"wait-on tcp:127.0.0.1:3000 &&npm-run-all watch\"",
|
||||
"watch": "tsc-watch -p tsconfig.e.json --onSuccess \"npm-run-all start:electron\"",
|
||||
"start:electron": "cross-env NODE_ENV=development electron .",
|
||||
"build": "cross-env REACT_APP_VERSION=$npm_package_version react-app-rewired build",
|
||||
|
@ -28,7 +28,7 @@
|
||||
"eslint-config-custom": "*",
|
||||
"prettier": "^2.5.1",
|
||||
"rimraf": "^5.0.5",
|
||||
"turbo": "2.0.9"
|
||||
"turbo": "2.2.1"
|
||||
},
|
||||
"packageManager": "yarn@1.22.19",
|
||||
"engines": {
|
||||
|
@ -256,6 +256,12 @@ export default class WKApp extends ProviderListener {
|
||||
WKApp.loginInfo.load(); // 加载登录信息
|
||||
|
||||
const themeMode = StorageService.shared.getItem("theme-mode");
|
||||
const currentSystemThemeModeIsDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)"
|
||||
).matches;
|
||||
if (!themeMode && currentSystemThemeModeIsDark) {
|
||||
WKApp.config.themeMode = ThemeMode.dark;
|
||||
}
|
||||
if (themeMode === "1") {
|
||||
WKApp.config.themeMode = ThemeMode.dark;
|
||||
}
|
||||
@ -374,14 +380,16 @@ export default class WKApp extends ProviderListener {
|
||||
return this.avatarChannel(c);
|
||||
}
|
||||
|
||||
avatarOrg(orgID: string){
|
||||
avatarOrg(orgID: string) {
|
||||
const baseURl = WKApp.apiClient.config.apiURL;
|
||||
return `${baseURl}organizations/${orgID}/logo`;
|
||||
}
|
||||
|
||||
// 我的用户头像发送改变
|
||||
myUserAvatarChange() {
|
||||
this.changeChannelAvatarTag(new Channel(WKApp.loginInfo.uid||"", ChannelTypePerson));
|
||||
this.changeChannelAvatarTag(
|
||||
new Channel(WKApp.loginInfo.uid || "", ChannelTypePerson)
|
||||
);
|
||||
}
|
||||
|
||||
changeChannelAvatarTag(channel: Channel) {
|
||||
@ -389,17 +397,17 @@ export default class WKApp extends ProviderListener {
|
||||
if (channel) {
|
||||
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
||||
}
|
||||
console.log('changeChannelAvatarTag0----->')
|
||||
console.log("changeChannelAvatarTag0----->");
|
||||
const t = new Date().getTime();
|
||||
WKApp.loginInfo.setStorageItem(myAvatarTag, `${t}`);
|
||||
}
|
||||
getChannelAvatarTag(channel? :Channel) {
|
||||
getChannelAvatarTag(channel?: Channel) {
|
||||
let myAvatarTag = "channelAvatarTag";
|
||||
if (channel) {
|
||||
myAvatarTag = `channelAvatarTag:${channel.channelType}${channel.channelID}`;
|
||||
}
|
||||
const tag = WKApp.loginInfo.getStorageItem(myAvatarTag);
|
||||
if(!tag) {
|
||||
if (!tag) {
|
||||
return "";
|
||||
}
|
||||
return tag;
|
||||
@ -530,13 +538,16 @@ export default class WKApp extends ProviderListener {
|
||||
return friendApplys;
|
||||
}
|
||||
|
||||
public setFriendApplysUnreadCount(){
|
||||
if(WKApp.loginInfo.isLogined()){
|
||||
WKApp.apiClient.get(`/user/reddot/friendApply`).then(res=>{
|
||||
WKApp.mittBus.emit('friend-applys-unread-count', res.count)
|
||||
WKApp.loginInfo.setStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`, res.count);
|
||||
public setFriendApplysUnreadCount() {
|
||||
if (WKApp.loginInfo.isLogined()) {
|
||||
WKApp.apiClient.get(`/user/reddot/friendApply`).then((res) => {
|
||||
WKApp.mittBus.emit("friend-applys-unread-count", res.count);
|
||||
WKApp.loginInfo.setStorageItem(
|
||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`,
|
||||
res.count
|
||||
);
|
||||
WKApp.menus.refresh();
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,7 +562,9 @@ export default class WKApp extends ProviderListener {
|
||||
// }
|
||||
// }
|
||||
if (WKApp.loginInfo.isLogined()) {
|
||||
const num = WKApp.loginInfo.getStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`)
|
||||
const num = WKApp.loginInfo.getStorageItem(
|
||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`
|
||||
);
|
||||
unreadCount = Number(num);
|
||||
}
|
||||
return unreadCount;
|
||||
@ -577,7 +590,10 @@ export default class WKApp extends ProviderListener {
|
||||
// WKApp.endpointManager.invokes(EndpointCategory.friendApplyDataChange);
|
||||
// }
|
||||
if (WKApp.loginInfo.isLogined()) {
|
||||
WKApp.loginInfo.setStorageItem(`${WKApp.loginInfo.uid}-friend-applys-unread-count`, '0')
|
||||
WKApp.loginInfo.setStorageItem(
|
||||
`${WKApp.loginInfo.uid}-friend-applys-unread-count`,
|
||||
"0"
|
||||
);
|
||||
}
|
||||
await WKApp.apiClient.delete(`/user/reddot/friendApply`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user